2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
3 <xsl:output method=
"html"/>
5 <xsl:template match=
"/">
6 <script type=
"text/javascript">
7 function toggleDiv(imgId, divId)
9 eDiv = document.getElementById(divId);
10 eImg = document.getElementById(imgId);
12 if ( eDiv.style.display ==
"none" )
14 eDiv.style.
display=
"block";
15 eImg.
src=
"images/arrow_minus_small.gif";
19 eDiv.style.display =
"none";
20 eImg.
src=
"images/arrow_plus_small.gif";
24 <div id=
"NAntTimingReport">
25 <h1>NAnt Build Timing Report
</h1>
27 <xsl:variable name=
"buildresults" select=
"//build/buildresults" />
29 <xsl:when test=
"count($buildresults) > 0">
30 <xsl:apply-templates select=
"$buildresults" />
33 <h2>Log does not contain any Xml output from NAnt.
</h2>
34 <p>Please make sure that NAnt is executed using the XmlLogger (use the argument:
<b>-logger:NAnt.Core.XmlLogger
</b>).
</p>
40 <xsl:template match=
"buildresults">
46 <td>Total Build Time:
</td>
47 <td><xsl:value-of select=
"../@buildtime"/></td>
58 <th align=
"left">Target
</th>
59 <th align=
"right">Duration (in seconds)
</th>
63 <xsl:apply-templates select=
"//target">
64 <xsl:sort select=
"duration" order=
"descending" data-type=
"number" />
65 </xsl:apply-templates>
71 <xsl:template match=
"target">
74 <xsl:variable name=
"divId">
75 <xsl:value-of select=
"generate-id()" />
77 <img src=
"images/arrow_plus_small.gif" alt=
"Toggle to see tasks in this target">
78 <xsl:attribute name=
"id">
79 <xsl:text>img-
</xsl:text>
80 <xsl:value-of select=
"$divId" />
82 <xsl:attribute name=
"onclick">toggleDiv('img-
<xsl:value-of select=
"$divId" />','
<xsl:value-of select=
"$divId" />')
</xsl:attribute>
84 <xsl:value-of select=
"@name" />
86 <xsl:attribute name=
"id">
87 <xsl:value-of select=
"$divId" />
89 <xsl:attribute name=
"style">
90 <xsl:text>display:none;
</xsl:text>
93 <xsl:apply-templates select=
"task">
94 <xsl:sort select=
"duration" order=
"descending" data-type=
"number" />
95 </xsl:apply-templates>
99 <td valign=
"top" align=
"right"><xsl:value-of select=
"format-number(duration div 1000,'##0.00')" /></td>
103 <xsl:template match=
"task">
104 <xsl:variable name=
"duration" select=
"format-number(duration div 1000,'##0.00')" />
105 <li><xsl:value-of select=
"@name" /> -
<xsl:value-of select=
"$duration" /> seconds
</li>