Skip to content

Instantly share code, notes, and snippets.

@poliarush
Created September 28, 2012 09:38
Show Gist options
  • Save poliarush/3798899 to your computer and use it in GitHub Desktop.
Save poliarush/3798899 to your computer and use it in GitHub Desktop.
Code generation simple NUnit html report
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<h1>total is <xsl:value-of select="test-results/@total"/></h1>
<h1>errors: <xsl:value-of select="test-results/@errors"/></h1>
<h1>failures <xsl:value-of select="test-results/@failures"/></h1>
<h1>time taken <xsl:value-of select="test-results/test-suite/@time"/></h1>
<table>
<tr>
<td>
<b>name</b>
</td>
<td>
<b>status</b>
</td>
<td>
<b>time</b>
</td>
</tr>
<xsl:for-each select="//test-case">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@result"/>
</td>
<td>
<xsl:value-of select="@time"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment