2 <!-- XSL stylesheet to convert checkstyle XML to HTML -->
3 <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
5 <!-- This tells the XSLT processor to emit HTML -->
6 <xsl:output method='html'
7 doctype-public='-//W3C//DTD HTML 4.01//EN'
8 doctype-system='http://www.w3.org/TR/html4/strict.dtd'
9 omit-xml-declaration='yes'/>
11 <!-- Match the checkstyle root element -->
12 <xsl:template match='checkstyle'>
15 <title>Checkstyle results</title>
16 <link rel='stylesheet' type='text/css' href='checkstyle.css' />
19 <h1>Checkstyle results</h1>
20 <div>The following document contains the results of
21 <a href='http://checkstyle.sourceforge.net/'>Checkstyle</a>.</div>
24 <table summary='Summary'>
26 <th>Files</th><th>Infos</th><th>Warnings</th><th>Errors</th>
29 <td><xsl:value-of select='count(file)' /></td>
30 <td><xsl:value-of select='count(file/error[@severity="info"])' /></td>
31 <td><xsl:value-of select='count(file/error[@severity="warning"])' /></td>
32 <td><xsl:value-of select='count(file/error[@severity="error"])' /></td>
37 <table summary='Files'>
39 <th>File</th><th>I</th><th>W</th><th>E</th>
41 <!-- Process file elements in file mode -->
42 <xsl:apply-templates select='file' mode='file'>
43 <xsl:sort select="@name"/>
44 </xsl:apply-templates>
47 <!-- Process file elements in detail mode -->
48 <xsl:apply-templates select='file' mode='detail'>
49 <xsl:sort select="@name"/>
50 </xsl:apply-templates>
55 <!-- Match a file element in file mode -->
56 <xsl:template match='file' mode='file'>
57 <xsl:if test='count(error) > 0'>
60 <xsl:element name='a'>
61 <xsl:attribute name='href'>
62 #<xsl:value-of select='translate(string(@name),"/","__")' />
64 <xsl:value-of select='@name' />
67 <td><xsl:value-of select='count(error[@severity="info"])' /></td>
68 <td><xsl:value-of select='count(error[@severity="warning"])' /></td>
69 <td><xsl:value-of select='count(error[@severity="error"])' /></td>
74 <!-- Match a file element in detail mode-->
75 <xsl:template match='file' mode='detail'>
76 <xsl:if test='count(error) > 0'>
78 <xsl:element name='a'>
79 <xsl:attribute name='name'>
80 <xsl:value-of select='translate(string(@name),"/","__")' />
82 <xsl:value-of select='@name' />
85 <table summary='Errors'>
87 <th>Error</th><th width="100px">Line</th>
89 <xsl:apply-templates select='error' />
94 <!-- Match an error element -->
95 <xsl:template match='error'>
97 <td><xsl:value-of select='@message'/></td>
98 <td><xsl:value-of select='@line' /></td>