Skip to content

Instantly share code, notes, and snippets.

@maartenba
Last active May 8, 2024 13:15
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save maartenba/b7b1866d11a54cf3bc9f04316afa1a9e to your computer and use it in GitHub Desktop.
Save maartenba/b7b1866d11a54cf3bc9f04316afa1a9e to your computer and use it in GitHub Desktop.
R# InspectCode XSLT
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:key name="ISSUETYPES" match="/Report/Issues/Project/Issue" use="@TypeId"/>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/" name="TopLevelReport">
<html>
<head>
<title>Resharper InspectCode Report</title>
<style>
body { font-family: Arial; }
th, td { text-align: left; }
.severity { font-weight: bold; }
</style>
</head>
<body>
<h1>Resharper InspectCode Report</h1>
<xsl:for-each select="/Report/IssueTypes/IssueType">
<h2>
<span class="severity"><xsl:value-of select="@Severity"/></span>: <xsl:value-of select="@Description"/>
</h2>
<table style="width:100%">
<tr>
<th>File</th>
<th>Line Number</th>
<th>Message</th>
</tr>
<xsl:for-each select="key('ISSUETYPES',@Id)">
<tr>
<td>
<xsl:value-of select="@File"/>
</td>
<td>
<xsl:value-of select="@Line"/>
</td>
<td>
<xsl:value-of select="@Message"/>
</td>
</tr>
</xsl:for-each>
</table>
<br />
<hr />
<br />
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
@mauriciogracia
Copy link

It works great thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment