Thursday, March 26, 2009

Fxcop stylesheet

For some reason FxCop still points to a stylesheet from gotdotnet which is broken.

Today we had a requirement to generate static code analysis report in a simple tabular form.

Following snippet did the job. You can apply any css on this for better look. Or even set style for table, tr and td.

<?xml version="1.0"?>
<
xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<
xsl:template match="/">
<
html>
<
body >
<
table>
<
xsl:for-each select="//Issue">
<
tr>
<
td><xsl:value-of select="@Certainty"/></td>
<
td><xsl:value-of select="@File"/></td>
<
td><xsl:value-of select="@Line"/></td>
<
td><xsl:value-of select="../@FixCategory"/></td>
<
td><xsl:value-of select="@Level"/></td>
<
td><xsl:value-of select="."/></td>
</
tr>
</
xsl:for-each>
</
table>
</
body>
</
html>
</
xsl:template>
</
xsl:stylesheet>

Just thought of sharing it.

No comments: