2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3 xmlns:lxslt="http://xml.apache.org/xslt"
4 xmlns:redirect="http://xml.apache.org/xalan/redirect"
5 xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
6 extension-element-prefixes="redirect">
7 <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
8 <xsl:decimal-format decimal-separator="." grouping-separator=","/>
10 Licensed to the Apache Software Foundation (ASF) under one or more
11 contributor license agreements. See the NOTICE file distributed with
12 this work for additional information regarding copyright ownership.
13 The ASF licenses this file to You under the Apache License, Version 2.0
14 (the "License"); you may not use this file except in compliance with
15 the License. You may obtain a copy of the License at
17 http://www.apache.org/licenses/LICENSE-2.0
19 Unless required by applicable law or agreed to in writing, software
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
28 Sample stylesheet to be used with Ant JUnitReport output.
30 It creates a set of HTML files a la javadoc where you can browse easily
31 through all packages and classes.
34 <xsl:param name="output.dir" select="'.'"/>
35 <xsl:param name="TITLE">Unit Test Results.</xsl:param>
38 <xsl:template match="testsuites">
39 <!-- create the index.html -->
40 <redirect:write file="{$output.dir}/index.html">
41 <xsl:call-template name="index.html"/>
44 <!-- create the stylesheet.css -->
45 <redirect:write file="{$output.dir}/stylesheet.css">
46 <xsl:call-template name="stylesheet.css"/>
49 <!-- create the overview-packages.html at the root -->
50 <redirect:write file="{$output.dir}/overview-summary.html">
51 <xsl:apply-templates select="." mode="overview.packages"/>
54 <!-- create the all-packages.html at the root -->
55 <redirect:write file="{$output.dir}/overview-frame.html">
56 <xsl:apply-templates select="." mode="all.packages"/>
59 <!-- create the all-classes.html at the root -->
60 <redirect:write file="{$output.dir}/allclasses-frame.html">
61 <xsl:apply-templates select="." mode="all.classes"/>
64 <!-- create the all-tests.html at the root -->
65 <redirect:write file="{$output.dir}/all-tests.html">
66 <xsl:apply-templates select="." mode="all.tests"/>
69 <!-- create the alltests-fails.html at the root -->
70 <redirect:write file="{$output.dir}/alltests-fails.html">
71 <xsl:apply-templates select="." mode="all.tests">
72 <xsl:with-param name="type" select="'fails'"/>
73 </xsl:apply-templates>
76 <!-- create the alltests-errors.html at the root -->
77 <redirect:write file="{$output.dir}/alltests-errors.html">
78 <xsl:apply-templates select="." mode="all.tests">
79 <xsl:with-param name="type" select="'errors'"/>
80 </xsl:apply-templates>
83 <!-- process all packages -->
84 <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
85 <xsl:call-template name="package">
86 <xsl:with-param name="name" select="@package"/>
92 <xsl:template name="package">
93 <xsl:param name="name"/>
94 <xsl:variable name="package.dir">
95 <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
96 <xsl:if test="$name = ''">.</xsl:if>
98 <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
99 <!-- create a classes-list.html in the package directory -->
100 <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
101 <xsl:call-template name="classes.list">
102 <xsl:with-param name="name" select="$name"/>
106 <!-- create a package-summary.html in the package directory -->
107 <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
108 <xsl:call-template name="package.summary">
109 <xsl:with-param name="name" select="$name"/>
113 <!-- for each class, creates a @name.html -->
114 <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
115 <xsl:for-each select="/testsuites/testsuite[@package = $name]">
116 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
117 <xsl:apply-templates select="." mode="class.details"/>
119 <xsl:if test="string-length(./system-out)!=0">
120 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-out.txt">
121 <xsl:value-of disable-output-escaping="yes" select="./system-out"/>
124 <xsl:if test="string-length(./system-err)!=0">
125 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.txt">
126 <xsl:value-of disable-output-escaping="yes" select="./system-err"/>
129 <xsl:if test="@failures != 0">
130 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-fails.html">
131 <xsl:apply-templates select="." mode="class.details">
132 <xsl:with-param name="type" select="'fails'"/>
133 </xsl:apply-templates>
136 <xsl:if test="@errors != 0">
137 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-errors.html">
138 <xsl:apply-templates select="." mode="class.details">
139 <xsl:with-param name="type" select="'errors'"/>
140 </xsl:apply-templates>
146 <xsl:template name="index.html">
149 <title><xsl:value-of select="$TITLE"/></title>
151 <frameset cols="20%,80%">
152 <frameset rows="30%,70%">
153 <frame src="overview-frame.html" name="packageListFrame"/>
154 <frame src="allclasses-frame.html" name="classListFrame"/>
156 <frame src="overview-summary.html" name="classFrame"/>
160 This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
167 <!-- this is the stylesheet css to use for nearly everything -->
168 <xsl:template name="stylesheet.css">
170 font:normal 68% verdana,arial,helvetica;
173 table tr td, table tr th {
187 margin-top:0.5em; margin-bottom:1.0em;
190 margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
193 margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
196 margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
199 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
202 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
205 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
208 font-weight:bold; color:red;
211 font-weight:bold; color:purple;
218 <!-- Create list of all/failed/errored tests -->
219 <xsl:template match="testsuites" mode="all.tests">
220 <xsl:param name="type" select="'all'"/>
222 <xsl:variable name="title">
224 <xsl:when test="$type = 'fails'">
225 <xsl:text>All Failures</xsl:text>
227 <xsl:when test="$type = 'errors'">
228 <xsl:text>All Errors</xsl:text>
231 <xsl:text>All Tests</xsl:text>
236 <title>Unit Test Results: <xsl:value-of select="$title"/></title>
237 <xsl:call-template name="create.stylesheet.link">
238 <xsl:with-param name="package.name"/>
242 <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
243 <xsl:call-template name="pageHeader"/>
244 <h2><xsl:value-of select="$title"/></h2>
246 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
247 <xsl:call-template name="testcase.test.header">
248 <xsl:with-param name="show.class" select="'yes'"/>
251 test can even not be started at all (failure to load the class)
252 so report the error directly
254 <xsl:if test="./error">
257 <xsl:apply-templates select="./error"/>
262 <xsl:when test="$type = 'fails'">
263 <xsl:apply-templates select=".//testcase[failure]" mode="print.test">
264 <xsl:with-param name="show.class" select="'yes'"/>
265 </xsl:apply-templates>
267 <xsl:when test="$type = 'errors'">
268 <xsl:apply-templates select=".//testcase[error]" mode="print.test">
269 <xsl:with-param name="show.class" select="'yes'"/>
270 </xsl:apply-templates>
273 <xsl:apply-templates select=".//testcase" mode="print.test">
274 <xsl:with-param name="show.class" select="'yes'"/>
275 </xsl:apply-templates>
284 <!-- ======================================================================
285 This page is created for every testsuite class.
286 It prints a summary of the testsuite and detailed information about
288 ====================================================================== -->
289 <xsl:template match="testsuite" mode="class.details">
290 <xsl:param name="type" select="'all'"/>
291 <xsl:variable name="package.name" select="@package"/>
292 <xsl:variable name="class.name"><xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></xsl:variable>
295 <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
296 <xsl:call-template name="create.stylesheet.link">
297 <xsl:with-param name="package.name" select="$package.name"/>
299 <script type="text/javascript" language="JavaScript">
300 var TestCases = new Array();
302 <xsl:apply-templates select="properties"/>
304 <script type="text/javascript" language="JavaScript"><![CDATA[
305 function displayProperties (name) {
306 var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
307 var doc = win.document;
309 doc.write("<html><head><title>Properties of " + name + "</title>");
310 doc.write("<style type=\"text/css\">");
311 doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
312 doc.write("table tr td, table tr th { font-size: 68%; }");
313 doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
314 doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
315 doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
316 doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
317 doc.write("</style>");
318 doc.write("</head><body>");
319 doc.write("<h3>Properties of " + name + "</h3>");
320 doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
321 doc.write("<table class='properties'>");
322 doc.write("<tr><th>Name</th><th>Value</th></tr>");
323 for (prop in TestCases[name]) {
324 doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
326 doc.write("</table>");
327 doc.write("</body></html>");
335 <xsl:call-template name="pageHeader"/>
336 <h3>Class <xsl:value-of select="$class.name"/></h3>
339 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
340 <xsl:call-template name="testsuite.test.header"/>
341 <xsl:apply-templates select="." mode="print.test"/>
345 <xsl:when test="$type = 'fails'">
348 <xsl:when test="$type = 'errors'">
355 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
356 <xsl:call-template name="testcase.test.header"/>
358 test can even not be started at all (failure to load the class)
359 so report the error directly
361 <xsl:if test="./error">
363 <td colspan="4"><xsl:apply-templates select="./error"/></td>
367 <xsl:when test="$type = 'fails'">
368 <xsl:apply-templates select="./testcase[failure]" mode="print.test"/>
370 <xsl:when test="$type = 'errors'">
371 <xsl:apply-templates select="./testcase[error]" mode="print.test"/>
374 <xsl:apply-templates select="./testcase" mode="print.test"/>
378 <div class="Properties">
380 <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
384 <xsl:if test="string-length(./system-out)!=0">
385 <div class="Properties">
387 <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-out.txt</xsl:attribute>
392 <xsl:if test="string-length(./system-err)!=0">
393 <div class="Properties">
395 <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-err.txt</xsl:attribute>
405 Write properties into a JavaScript data structure.
406 This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
408 <xsl:template match="properties">
409 cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
410 <xsl:for-each select="property">
411 <xsl:sort select="@name"/>
412 cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
417 <!-- ======================================================================
418 This page is created for every package.
419 It prints the name of all classes that belongs to this package.
420 @param name the package name to print classes.
421 ====================================================================== -->
422 <!-- list of classes in a package -->
423 <xsl:template name="classes.list">
424 <xsl:param name="name"/>
427 <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
428 <xsl:call-template name="create.stylesheet.link">
429 <xsl:with-param name="package.name" select="$name"/>
436 <h2><a href="package-summary.html" target="classFrame">
437 <xsl:value-of select="$name"/>
438 <xsl:if test="$name = ''"><none></xsl:if>
446 <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
447 <xsl:sort select="@name"/>
450 <a href="{@id}_{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
461 Creates an all-classes.html file that contains a link to all package-summary.html
464 <xsl:template match="testsuites" mode="all.classes">
467 <title>All Unit Test Classes</title>
468 <xsl:call-template name="create.stylesheet.link">
469 <xsl:with-param name="package.name"/>
475 <xsl:apply-templates select="testsuite" mode="all.classes">
476 <xsl:sort select="@name"/>
477 </xsl:apply-templates>
483 <xsl:template match="testsuite" mode="all.classes">
484 <xsl:variable name="package.name" select="@package"/>
487 <a target="classFrame">
488 <xsl:attribute name="href">
489 <xsl:if test="not($package.name='')">
490 <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
491 </xsl:if><xsl:value-of select="@id"/>_<xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
493 <xsl:value-of select="@name"/>
501 Creates an html file that contains a link to all package-summary.html files on
502 each package existing on testsuites.
503 @bug there will be a problem here, I don't know yet how to handle unnamed package :(
505 <xsl:template match="testsuites" mode="all.packages">
508 <title>All Unit Test Packages</title>
509 <xsl:call-template name="create.stylesheet.link">
510 <xsl:with-param name="package.name"/>
514 <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
517 <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
518 <xsl:sort select="@package"/>
519 </xsl:apply-templates>
525 <xsl:template match="testsuite" mode="all.packages">
528 <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
529 <xsl:value-of select="@package"/>
530 <xsl:if test="@package = ''"><none></xsl:if>
537 <xsl:template match="testsuites" mode="overview.packages">
540 <title>Unit Test Results: Summary</title>
541 <xsl:call-template name="create.stylesheet.link">
542 <xsl:with-param name="package.name"/>
546 <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
547 <xsl:call-template name="pageHeader"/>
549 <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
550 <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
551 <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
552 <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
553 <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
554 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
559 <th>Success rate</th>
563 <xsl:attribute name="class">
565 <xsl:when test="$errorCount > 0">Error</xsl:when>
566 <xsl:when test="$failureCount > 0">Failure</xsl:when>
567 <xsl:otherwise>Pass</xsl:otherwise>
570 <td><a title="Display all tests" href="all-tests.html"><xsl:value-of select="$testCount"/></a></td>
571 <td><a title="Display all failures" href="alltests-fails.html"><xsl:value-of select="$failureCount"/></a></td>
572 <td><a title="Display all errors" href="alltests-errors.html"><xsl:value-of select="$errorCount"/></a></td>
574 <xsl:call-template name="display-percent">
575 <xsl:with-param name="value" select="$successRate"/>
579 <xsl:call-template name="display-time">
580 <xsl:with-param name="value" select="$timeCount"/>
585 <table border="0" width="95%">
587 <td style="text-align: justify;">
588 Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
594 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
595 <xsl:call-template name="testsuite.test.header"/>
596 <xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
597 <xsl:sort select="@package" order="ascending"/>
598 <!-- get the node set containing all testsuites that have the same package -->
599 <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
601 <!-- display a failure if there is any failure/error in the package -->
602 <xsl:attribute name="class">
604 <xsl:when test="sum($insamepackage/@errors) > 0">Error</xsl:when>
605 <xsl:when test="sum($insamepackage/@failures) > 0">Failure</xsl:when>
606 <xsl:otherwise>Pass</xsl:otherwise>
609 <td><a href="./{translate(@package,'.','/')}/package-summary.html">
610 <xsl:value-of select="@package"/>
611 <xsl:if test="@package = ''"><none></xsl:if>
613 <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
614 <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
615 <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
617 <xsl:call-template name="display-time">
618 <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
621 <td><xsl:value-of select="$insamepackage/@timestamp"/></td>
622 <td><xsl:value-of select="$insamepackage/@hostname"/></td>
631 <xsl:template name="package.summary">
632 <xsl:param name="name"/>
635 <xsl:call-template name="create.stylesheet.link">
636 <xsl:with-param name="package.name" select="$name"/>
640 <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
641 <xsl:call-template name="pageHeader"/>
642 <h3>Package <xsl:value-of select="$name"/></h3>
644 <!--table border="0" cellpadding="5" cellspacing="2" width="95%">
645 <xsl:call-template name="class.metrics.header"/>
646 <xsl:apply-templates select="." mode="print.metrics"/>
649 <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
650 <xsl:if test="count($insamepackage) > 0">
653 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
654 <xsl:call-template name="testsuite.test.header"/>
655 <xsl:apply-templates select="$insamepackage" mode="print.test">
656 <xsl:sort select="@name"/>
657 </xsl:apply-templates>
667 transform string like a.b.c to ../../../
668 @param path the path to transform into a descending directory path
670 <xsl:template name="path">
671 <xsl:param name="path"/>
672 <xsl:if test="contains($path,'.')">
673 <xsl:text>../</xsl:text>
674 <xsl:call-template name="path">
675 <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
678 <xsl:if test="not(contains($path,'.')) and not($path = '')">
679 <xsl:text>../</xsl:text>
684 <!-- create the link to the stylesheet based on the package name -->
685 <xsl:template name="create.stylesheet.link">
686 <xsl:param name="package.name"/>
687 <link rel="stylesheet" type="text/css" title="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
692 <xsl:template name="pageHeader">
693 <h1><xsl:value-of select="$TITLE"/></h1>
696 <td align="left"></td>
697 <td align="right">Designed for use with <a href="http://www.junit.org/">JUnit</a> and <a href="http://ant.apache.org/">Ant</a>.</td>
703 <!-- class header -->
704 <xsl:template name="testsuite.test.header">
706 <th width="80%">Name</th>
710 <th nowrap="nowrap">Time(s)</th>
711 <th nowrap="nowrap">Time Stamp</th>
716 <!-- method header -->
717 <xsl:template name="testcase.test.header">
718 <xsl:param name="show.class" select="''"/>
720 <xsl:if test="boolean($show.class)">
725 <th width="80%">Type</th>
726 <th nowrap="nowrap">Time(s)</th>
731 <!-- class information -->
732 <xsl:template match="testsuite" mode="print.test">
734 <xsl:attribute name="class">
736 <xsl:when test="@errors[.> 0]">Error</xsl:when>
737 <xsl:when test="@failures[.> 0]">Failure</xsl:when>
738 <xsl:otherwise>Pass</xsl:otherwise>
741 <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:value-of select="@name"/></a></td>
742 <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:apply-templates select="@tests"/></a></td>
745 <xsl:when test="@errors != 0">
746 <a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="@errors"/></a>
749 <xsl:apply-templates select="@errors"/>
755 <xsl:when test="@failures != 0">
756 <a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="@failures"/></a>
759 <xsl:apply-templates select="@failures"/>
763 <td><xsl:call-template name="display-time">
764 <xsl:with-param name="value" select="@time"/>
767 <td><xsl:apply-templates select="@timestamp"/></td>
768 <td><xsl:apply-templates select="@hostname"/></td>
772 <xsl:template match="testcase" mode="print.test">
773 <xsl:param name="show.class" select="''"/>
775 <xsl:attribute name="class">
777 <xsl:when test="error">Error</xsl:when>
778 <xsl:when test="failure">Failure</xsl:when>
779 <xsl:otherwise>TableRowColor</xsl:otherwise>
782 <xsl:variable name="class.href">
783 <xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
785 <xsl:if test="boolean($show.class)">
786 <td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
791 <xsl:when test="boolean($show.class)">
792 <a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
795 <xsl:value-of select="@name"/>
800 <xsl:when test="failure">
802 <td><xsl:apply-templates select="failure"/></td>
804 <xsl:when test="error">
806 <td><xsl:apply-templates select="error"/></td>
814 <xsl:call-template name="display-time">
815 <xsl:with-param name="value" select="@time"/>
822 <!-- Note : the below template error and failure are the same style
823 so just call the same style store in the toolkit template -->
824 <xsl:template match="failure">
825 <xsl:call-template name="display-failures"/>
828 <xsl:template match="error">
829 <xsl:call-template name="display-failures"/>
832 <!-- Style for the error and failure in the testcase template -->
833 <xsl:template name="display-failures">
835 <xsl:when test="not(@message)">N/A</xsl:when>
837 <xsl:value-of select="@message"/>
840 <!-- display the stacktrace -->
843 <xsl:call-template name="br-replace">
844 <xsl:with-param name="word" select="."/>
847 <!-- the latter is better but might be problematic for non-21" monitors... -->
848 <!--pre><xsl:value-of select="."/></pre-->
851 <xsl:template name="JS-escape">
852 <xsl:param name="string"/>
853 <xsl:param name="tmp1" select="stringutils:replace(string($string),'\','\\')"/>
854 <xsl:param name="tmp2" select="stringutils:replace(string($tmp1),"'","\'")"/>
855 <xsl:value-of select="$tmp2"/>
860 template that will convert a carriage return into a br tag
861 @param word the text from which to convert CR to BR tag
863 <xsl:template name="br-replace">
864 <xsl:param name="word"/>
865 <xsl:value-of disable-output-escaping="yes" select='stringutils:replace(string($word),"
","<br/>")'/>
868 <xsl:template name="display-time">
869 <xsl:param name="value"/>
870 <xsl:value-of select="format-number($value,'0.000')"/>
873 <xsl:template name="display-percent">
874 <xsl:param name="value"/>
875 <xsl:value-of select="format-number($value,'0.00%')"/>