1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
2 xmlns:lxslt="http://xml.apache.org/xslt"
3 xmlns:redirect="http://xml.apache.org/xalan/redirect"
4 xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
5 extension-element-prefixes="redirect">
6 <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
7 <xsl:decimal-format decimal-separator="." grouping-separator=","/>
9 Licensed to the Apache Software Foundation (ASF) under one or more
10 contributor license agreements. See the NOTICE file distributed with
11 this work for additional information regarding copyright ownership.
12 The ASF licenses this file to You under the Apache License, Version 2.0
13 (the "License"); you may not use this file except in compliance with
14 the License. You may obtain a copy of the License at
16 http://www.apache.org/licenses/LICENSE-2.0
18 Unless required by applicable law or agreed to in writing, software
19 distributed under the License is distributed on an "AS IS" BASIS,
20 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 See the License for the specific language governing permissions and
22 limitations under the License.
27 Sample stylesheet to be used with Ant JUnitReport output.
29 It creates a set of HTML files a la javadoc where you can browse easily
30 through all packages and classes.
33 <xsl:param name="output.dir" select="'.'"/>
36 <xsl:template match="testsuites">
37 <!-- create the index.html -->
38 <redirect:write file="{$output.dir}/index.html">
39 <xsl:call-template name="index.html"/>
42 <!-- create the stylesheet.css -->
43 <redirect:write file="{$output.dir}/stylesheet.css">
44 <xsl:call-template name="stylesheet.css"/>
47 <!-- create the overview-packages.html at the root -->
48 <redirect:write file="{$output.dir}/overview-summary.html">
49 <xsl:apply-templates select="." mode="overview.packages"/>
52 <!-- create the all-packages.html at the root -->
53 <redirect:write file="{$output.dir}/overview-frame.html">
54 <xsl:apply-templates select="." mode="all.packages"/>
57 <!-- create the all-classes.html at the root -->
58 <redirect:write file="{$output.dir}/allclasses-frame.html">
59 <xsl:apply-templates select="." mode="all.classes"/>
62 <!-- create the all-tests.html at the root -->
63 <redirect:write file="{$output.dir}/all-tests.html">
64 <xsl:apply-templates select="." mode="all.tests"/>
67 <!-- create the alltests-fails.html at the root -->
68 <redirect:write file="{$output.dir}/alltests-fails.html">
69 <xsl:apply-templates select="." mode="all.tests">
70 <xsl:with-param name="type" select="'fails'"/>
71 </xsl:apply-templates>
74 <!-- create the alltests-errors.html at the root -->
75 <redirect:write file="{$output.dir}/alltests-errors.html">
76 <xsl:apply-templates select="." mode="all.tests">
77 <xsl:with-param name="type" select="'errors'"/>
78 </xsl:apply-templates>
81 <!-- process all packages -->
82 <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
83 <xsl:call-template name="package">
84 <xsl:with-param name="name" select="@package"/>
90 <xsl:template name="package">
91 <xsl:param name="name"/>
92 <xsl:variable name="package.dir">
93 <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
94 <xsl:if test="$name = ''">.</xsl:if>
96 <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
97 <!-- create a classes-list.html in the package directory -->
98 <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
99 <xsl:call-template name="classes.list">
100 <xsl:with-param name="name" select="$name"/>
104 <!-- create a package-summary.html in the package directory -->
105 <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
106 <xsl:call-template name="package.summary">
107 <xsl:with-param name="name" select="$name"/>
111 <!-- for each class, creates a @name.html -->
112 <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
113 <xsl:for-each select="/testsuites/testsuite[@package = $name]">
114 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
115 <xsl:apply-templates select="." mode="class.details"/>
117 <xsl:if test="string-length(./system-out)!=0">
118 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-out.txt">
119 <xsl:value-of disable-output-escaping="yes" select="./system-out"/>
122 <xsl:if test="string-length(./system-err)!=0">
123 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.txt">
124 <xsl:value-of disable-output-escaping="yes" select="./system-err"/>
127 <xsl:if test="@failures != 0">
128 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-fails.html">
129 <xsl:apply-templates select="." mode="class.details">
130 <xsl:with-param name="type" select="'fails'"/>
131 </xsl:apply-templates>
134 <xsl:if test="@errors != 0">
135 <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-errors.html">
136 <xsl:apply-templates select="." mode="class.details">
137 <xsl:with-param name="type" select="'errors'"/>
138 </xsl:apply-templates>
144 <xsl:template name="index.html">
147 <title>Unit Test Results.</title>
149 <frameset cols="20%,80%">
150 <frameset rows="30%,70%">
151 <frame src="overview-frame.html" name="packageListFrame"/>
152 <frame src="allclasses-frame.html" name="classListFrame"/>
154 <frame src="overview-summary.html" name="classFrame"/>
158 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.
165 <!-- this is the stylesheet css to use for nearly everything -->
166 <xsl:template name="stylesheet.css">
168 font:normal 68% verdana,arial,helvetica;
171 table tr td, table tr th {
185 margin-top:0.5em; margin-bottom:1.0em;
188 margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
191 margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
194 margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
197 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
200 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
203 margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
206 font-weight:bold; color:red;
209 font-weight:bold; color:purple;
216 <!-- Create list of all/failed/errored tests -->
217 <xsl:template match="testsuites" mode="all.tests">
218 <xsl:param name="type" select="'all'"/>
220 <xsl:variable name="title">
222 <xsl:when test="$type = 'fails'">
223 <xsl:text>All Failures</xsl:text>
225 <xsl:when test="$type = 'errors'">
226 <xsl:text>All Errors</xsl:text>
229 <xsl:text>All Tests</xsl:text>
234 <title>Unit Test Results: <xsl:value-of select="$title"/></title>
235 <xsl:call-template name="create.stylesheet.link">
236 <xsl:with-param name="package.name"/>
240 <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
241 <xsl:call-template name="pageHeader"/>
242 <h2><xsl:value-of select="$title"/></h2>
244 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
245 <xsl:call-template name="testcase.test.header">
246 <xsl:with-param name="show.class" select="'yes'"/>
249 test can even not be started at all (failure to load the class)
250 so report the error directly
252 <xsl:if test="./error">
255 <xsl:apply-templates select="./error"/>
260 <xsl:when test="$type = 'fails'">
261 <xsl:apply-templates select=".//testcase[failure]" mode="print.test">
262 <xsl:with-param name="show.class" select="'yes'"/>
263 </xsl:apply-templates>
265 <xsl:when test="$type = 'errors'">
266 <xsl:apply-templates select=".//testcase[error]" mode="print.test">
267 <xsl:with-param name="show.class" select="'yes'"/>
268 </xsl:apply-templates>
271 <xsl:apply-templates select=".//testcase" mode="print.test">
272 <xsl:with-param name="show.class" select="'yes'"/>
273 </xsl:apply-templates>
282 <!-- ======================================================================
283 This page is created for every testsuite class.
284 It prints a summary of the testsuite and detailed information about
286 ====================================================================== -->
287 <xsl:template match="testsuite" mode="class.details">
288 <xsl:param name="type" select="'all'"/>
289 <xsl:variable name="package.name" select="@package"/>
290 <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>
293 <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
294 <xsl:call-template name="create.stylesheet.link">
295 <xsl:with-param name="package.name" select="$package.name"/>
297 <script type="text/javascript" language="JavaScript">
298 var TestCases = new Array();
300 <xsl:apply-templates select="properties"/>
302 <script type="text/javascript" language="JavaScript"><![CDATA[
303 function displayProperties (name) {
304 var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
305 var doc = win.document;
307 doc.write("<html><head><title>Properties of " + name + "</title>");
308 doc.write("<style type=\"text/css\">");
309 doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
310 doc.write("table tr td, table tr th { font-size: 68%; }");
311 doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
312 doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
313 doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
314 doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
315 doc.write("</style>");
316 doc.write("</head><body>");
317 doc.write("<h3>Properties of " + name + "</h3>");
318 doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
319 doc.write("<table class='properties'>");
320 doc.write("<tr><th>Name</th><th>Value</th></tr>");
321 for (prop in TestCases[name]) {
322 doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
324 doc.write("</table>");
325 doc.write("</body></html>");
333 <xsl:call-template name="pageHeader"/>
334 <h3>Class <xsl:value-of select="$class.name"/></h3>
337 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
338 <xsl:call-template name="testsuite.test.header"/>
339 <xsl:apply-templates select="." mode="print.test"/>
343 <xsl:when test="$type = 'fails'">
346 <xsl:when test="$type = 'errors'">
353 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
354 <xsl:call-template name="testcase.test.header"/>
356 test can even not be started at all (failure to load the class)
357 so report the error directly
359 <xsl:if test="./error">
361 <td colspan="4"><xsl:apply-templates select="./error"/></td>
365 <xsl:when test="$type = 'fails'">
366 <xsl:apply-templates select="./testcase[failure]" mode="print.test"/>
368 <xsl:when test="$type = 'errors'">
369 <xsl:apply-templates select="./testcase[error]" mode="print.test"/>
372 <xsl:apply-templates select="./testcase" mode="print.test"/>
376 <div class="Properties">
378 <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
382 <xsl:if test="string-length(./system-out)!=0">
383 <div class="Properties">
385 <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-out.txt</xsl:attribute>
390 <xsl:if test="string-length(./system-err)!=0">
391 <div class="Properties">
393 <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-err.txt</xsl:attribute>
403 Write properties into a JavaScript data structure.
404 This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
406 <xsl:template match="properties">
407 cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
408 <xsl:for-each select="property">
409 <xsl:sort select="@name"/>
410 cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
415 <!-- ======================================================================
416 This page is created for every package.
417 It prints the name of all classes that belongs to this package.
418 @param name the package name to print classes.
419 ====================================================================== -->
420 <!-- list of classes in a package -->
421 <xsl:template name="classes.list">
422 <xsl:param name="name"/>
425 <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
426 <xsl:call-template name="create.stylesheet.link">
427 <xsl:with-param name="package.name" select="$name"/>
434 <h2><a href="package-summary.html" target="classFrame">
435 <xsl:value-of select="$name"/>
436 <xsl:if test="$name = ''"><none></xsl:if>
444 <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
445 <xsl:sort select="@name"/>
448 <a href="{@id}_{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
459 Creates an all-classes.html file that contains a link to all package-summary.html
462 <xsl:template match="testsuites" mode="all.classes">
465 <title>All Unit Test Classes</title>
466 <xsl:call-template name="create.stylesheet.link">
467 <xsl:with-param name="package.name"/>
473 <xsl:apply-templates select="testsuite" mode="all.classes">
474 <xsl:sort select="@name"/>
475 </xsl:apply-templates>
481 <xsl:template match="testsuite" mode="all.classes">
482 <xsl:variable name="package.name" select="@package"/>
485 <a target="classFrame">
486 <xsl:attribute name="href">
487 <xsl:if test="not($package.name='')">
488 <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
489 </xsl:if><xsl:value-of select="@id"/>_<xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
491 <xsl:value-of select="@name"/>
499 Creates an html file that contains a link to all package-summary.html files on
500 each package existing on testsuites.
501 @bug there will be a problem here, I don't know yet how to handle unnamed package :(
503 <xsl:template match="testsuites" mode="all.packages">
506 <title>All Unit Test Packages</title>
507 <xsl:call-template name="create.stylesheet.link">
508 <xsl:with-param name="package.name"/>
512 <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
515 <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
516 <xsl:sort select="@package"/>
517 </xsl:apply-templates>
523 <xsl:template match="testsuite" mode="all.packages">
526 <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
527 <xsl:value-of select="@package"/>
528 <xsl:if test="@package = ''"><none></xsl:if>
535 <xsl:template match="testsuites" mode="overview.packages">
538 <title>Unit Test Results: Summary</title>
539 <xsl:call-template name="create.stylesheet.link">
540 <xsl:with-param name="package.name"/>
544 <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
545 <xsl:call-template name="pageHeader"/>
547 <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
548 <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
549 <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
550 <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
551 <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
552 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
557 <th>Success rate</th>
561 <xsl:attribute name="class">
563 <xsl:when test="$errorCount > 0">Error</xsl:when>
564 <xsl:when test="$failureCount > 0">Failure</xsl:when>
565 <xsl:otherwise>Pass</xsl:otherwise>
568 <td><a title="Display all tests" href="all-tests.html"><xsl:value-of select="$testCount"/></a></td>
569 <td><a title="Display all failures" href="alltests-fails.html"><xsl:value-of select="$failureCount"/></a></td>
570 <td><a title="Display all errors" href="alltests-errors.html"><xsl:value-of select="$errorCount"/></a></td>
572 <xsl:call-template name="display-percent">
573 <xsl:with-param name="value" select="$successRate"/>
577 <xsl:call-template name="display-time">
578 <xsl:with-param name="value" select="$timeCount"/>
583 <table border="0" width="95%">
585 <td style="text-align: justify;">
586 Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
592 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
593 <xsl:call-template name="testsuite.test.header"/>
594 <xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
595 <xsl:sort select="@package" order="ascending"/>
596 <!-- get the node set containing all testsuites that have the same package -->
597 <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
599 <!-- display a failure if there is any failure/error in the package -->
600 <xsl:attribute name="class">
602 <xsl:when test="sum($insamepackage/@errors) > 0">Error</xsl:when>
603 <xsl:when test="sum($insamepackage/@failures) > 0">Failure</xsl:when>
604 <xsl:otherwise>Pass</xsl:otherwise>
607 <td><a href="./{translate(@package,'.','/')}/package-summary.html">
608 <xsl:value-of select="@package"/>
609 <xsl:if test="@package = ''"><none></xsl:if>
611 <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
612 <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
613 <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
615 <xsl:call-template name="display-time">
616 <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
619 <td><xsl:value-of select="$insamepackage/@timestamp"/></td>
620 <td><xsl:value-of select="$insamepackage/@hostname"/></td>
629 <xsl:template name="package.summary">
630 <xsl:param name="name"/>
633 <xsl:call-template name="create.stylesheet.link">
634 <xsl:with-param name="package.name" select="$name"/>
638 <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
639 <xsl:call-template name="pageHeader"/>
640 <h3>Package <xsl:value-of select="$name"/></h3>
642 <!--table border="0" cellpadding="5" cellspacing="2" width="95%">
643 <xsl:call-template name="class.metrics.header"/>
644 <xsl:apply-templates select="." mode="print.metrics"/>
647 <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
648 <xsl:if test="count($insamepackage) > 0">
651 <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
652 <xsl:call-template name="testsuite.test.header"/>
653 <xsl:apply-templates select="$insamepackage" mode="print.test">
654 <xsl:sort select="@name"/>
655 </xsl:apply-templates>
665 transform string like a.b.c to ../../../
666 @param path the path to transform into a descending directory path
668 <xsl:template name="path">
669 <xsl:param name="path"/>
670 <xsl:if test="contains($path,'.')">
671 <xsl:text>../</xsl:text>
672 <xsl:call-template name="path">
673 <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
676 <xsl:if test="not(contains($path,'.')) and not($path = '')">
677 <xsl:text>../</xsl:text>
682 <!-- create the link to the stylesheet based on the package name -->
683 <xsl:template name="create.stylesheet.link">
684 <xsl:param name="package.name"/>
685 <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>
690 <xsl:template name="pageHeader">
691 <h1>Unit Test Results</h1>
694 <td align="left"></td>
695 <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>
701 <!-- class header -->
702 <xsl:template name="testsuite.test.header">
704 <th width="80%">Name</th>
708 <th nowrap="nowrap">Time(s)</th>
709 <th nowrap="nowrap">Time Stamp</th>
714 <!-- method header -->
715 <xsl:template name="testcase.test.header">
716 <xsl:param name="show.class" select="''"/>
718 <xsl:if test="boolean($show.class)">
723 <th width="80%">Type</th>
724 <th nowrap="nowrap">Time(s)</th>
729 <!-- class information -->
730 <xsl:template match="testsuite" mode="print.test">
732 <xsl:attribute name="class">
734 <xsl:when test="@errors[.> 0]">Error</xsl:when>
735 <xsl:when test="@failures[.> 0]">Failure</xsl:when>
736 <xsl:otherwise>Pass</xsl:otherwise>
739 <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:value-of select="@name"/></a></td>
740 <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:apply-templates select="@tests"/></a></td>
743 <xsl:when test="@errors != 0">
744 <a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="@errors"/></a>
747 <xsl:apply-templates select="@errors"/>
753 <xsl:when test="@failures != 0">
754 <a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="@failures"/></a>
757 <xsl:apply-templates select="@failures"/>
761 <td><xsl:call-template name="display-time">
762 <xsl:with-param name="value" select="@time"/>
765 <td><xsl:apply-templates select="@timestamp"/></td>
766 <td><xsl:apply-templates select="@hostname"/></td>
770 <xsl:template match="testcase" mode="print.test">
771 <xsl:param name="show.class" select="''"/>
773 <xsl:attribute name="class">
775 <xsl:when test="error">Error</xsl:when>
776 <xsl:when test="failure">Failure</xsl:when>
777 <xsl:otherwise>TableRowColor</xsl:otherwise>
780 <xsl:variable name="class.href">
781 <xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
783 <xsl:if test="boolean($show.class)">
784 <td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
789 <xsl:when test="boolean($show.class)">
790 <a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
793 <xsl:value-of select="@name"/>
798 <xsl:when test="failure">
800 <td><xsl:apply-templates select="failure"/></td>
802 <xsl:when test="error">
804 <td><xsl:apply-templates select="error"/></td>
812 <xsl:call-template name="display-time">
813 <xsl:with-param name="value" select="@time"/>
820 <!-- Note : the below template error and failure are the same style
821 so just call the same style store in the toolkit template -->
822 <xsl:template match="failure">
823 <xsl:call-template name="display-failures"/>
826 <xsl:template match="error">
827 <xsl:call-template name="display-failures"/>
830 <!-- Style for the error and failure in the testcase template -->
831 <xsl:template name="display-failures">
833 <xsl:when test="not(@message)">N/A</xsl:when>
835 <xsl:value-of select="@message"/>
838 <!-- display the stacktrace -->
841 <xsl:call-template name="br-replace">
842 <xsl:with-param name="word" select="."/>
845 <!-- the latter is better but might be problematic for non-21" monitors... -->
846 <!--pre><xsl:value-of select="."/></pre-->
849 <xsl:template name="JS-escape">
850 <xsl:param name="string"/>
851 <xsl:param name="tmp1" select="stringutils:replace(string($string),'\','\\')"/>
852 <xsl:param name="tmp2" select="stringutils:replace(string($tmp1),"'","\'")"/>
853 <xsl:value-of select="$tmp2"/>
858 template that will convert a carriage return into a br tag
859 @param word the text from which to convert CR to BR tag
861 <xsl:template name="br-replace">
862 <xsl:param name="word"/>
863 <xsl:value-of disable-output-escaping="yes" select='stringutils:replace(string($word),"
","<br/>")'/>
866 <xsl:template name="display-time">
867 <xsl:param name="value"/>
868 <xsl:value-of select="format-number($value,'0.000')"/>
871 <xsl:template name="display-percent">
872 <xsl:param name="value"/>
873 <xsl:value-of select="format-number($value,'0.00%')"/>