| 1 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" |
| 2 |
xmlns:c="http://check.sourceforge.net/ns"> |
| 3 |
|
| 4 |
<!-- |
| 5 |
|
| 6 |
[email protected], 13-MAR-2006 |
| 7 |
|
| 8 |
You can use this xslt on the commandline as follows: |
| 9 |
$ xsltproc check_unittest.xslt check_output.xml > check_output.html |
| 10 |
|
| 11 |
--> |
| 12 |
|
| 13 |
<xsl:output method="html"/> |
| 14 |
|
| 15 |
<xsl:template match="c:testsuites"> |
| 16 |
<html><title>Test results</title><body> |
| 17 |
<p> |
| 18 |
<table width="100%" border="1" cellpadding="0"> |
| 19 |
<tr><td colspan="7" style='background:#e5E5f5'><h1>Unittests</h1></td></tr> |
| 20 |
<xsl:apply-templates/> |
| 21 |
</table></p> |
| 22 |
</body></html> |
| 23 |
</xsl:template> |
| 24 |
|
| 25 |
<xsl:template match="c:suite"> |
| 26 |
<xsl:apply-templates/> |
| 27 |
</xsl:template> |
| 28 |
|
| 29 |
<xsl:template match="c:title"> |
| 30 |
<tr> |
| 31 |
<th colspan="7">Test suite <xsl:apply-templates/></th> |
| 32 |
</tr> |
| 33 |
<tr> |
| 34 |
<td>Path</td> |
| 35 |
<td>Filename</td> |
| 36 |
<td>Test ID</td> |
| 37 |
<td>Iteration</td> |
| 38 |
<td>Duration</td> |
| 39 |
<td>Description</td> |
| 40 |
<td>Message</td> |
| 41 |
</tr> |
| 42 |
</xsl:template> |
| 43 |
|
| 44 |
<xsl:template match="c:datetime"> |
| 45 |
<tr><th colspan="7">Test ran at: <xsl:apply-templates/></th></tr> |
| 46 |
</xsl:template> |
| 47 |
|
| 48 |
<xsl:template match="c:test[@result='success']"> |
| 49 |
<tr bgcolor="green"><xsl:apply-templates/></tr> |
| 50 |
</xsl:template> |
| 51 |
|
| 52 |
<xsl:template match="c:test[@result='error']"> |
| 53 |
<tr bgcolor="red"><xsl:apply-templates/></tr> |
| 54 |
</xsl:template> |
| 55 |
|
| 56 |
<xsl:template match="c:test[@result='failure']"> |
| 57 |
<tr bgcolor="red"><xsl:apply-templates/></tr> |
| 58 |
</xsl:template> |
| 59 |
|
| 60 |
<xsl:template match="c:path"> |
| 61 |
<td><xsl:apply-templates/></td> |
| 62 |
</xsl:template> |
| 63 |
|
| 64 |
<xsl:template match="c:fn"> |
| 65 |
<td><xsl:apply-templates/></td> |
| 66 |
</xsl:template> |
| 67 |
|
| 68 |
<xsl:template match="c:id"> |
| 69 |
<td><xsl:apply-templates/></td> |
| 70 |
</xsl:template> |
| 71 |
|
| 72 |
<xsl:template match="c:iteration"> |
| 73 |
<td><xsl:apply-templates/></td> |
| 74 |
</xsl:template> |
| 75 |
|
| 76 |
<xsl:template match="c:description"> |
| 77 |
<td><xsl:apply-templates/></td> |
| 78 |
</xsl:template> |
| 79 |
|
| 80 |
<xsl:template match="c:message"> |
| 81 |
<td><pre><tt><xsl:apply-templates/></tt></pre></td> |
| 82 |
</xsl:template> |
| 83 |
|
| 84 |
<xsl:template match="c:test/c:duration"> |
| 85 |
<td><xsl:apply-templates/></td> |
| 86 |
</xsl:template> |
| 87 |
|
| 88 |
<xsl:template match="c:duration"> |
| 89 |
<tr><th colspan="7">Test duration: <xsl:apply-templates/> seconds</th></tr> |
| 90 |
</xsl:template> |
| 91 |
|
| 92 |
</xsl:stylesheet> |
| 93 |
|