119 lines
3.8 KiB
XML

<!--
* ========================================================================
*
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ========================================================================
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:key name="errors-by-message" match="//error" use="@message" />
<xsl:template match="/">
<document>
<properties>
<title>Checkstyle Results</title>
</properties>
<body>
<section name="Checkstyle Results">
<p>
The following document contains the results of
<a href="http://checkstyle.sourceforge.net/">Checkstyle</a>
<a href="checkstyle.rss"><img src="images/rss.png"/></a>.
</p>
</section>
<section name="Detailed reports">
<p>
<ul>
<li><a href="all.html">All problems</a></li>
<li><a href="error.html">Error level problems</a></li>
<li><a href="warning.html">Warning level problems</a></li>
<li><a href="info.html">Info level problems</a></li>
</ul>
</p>
</section>
<section name="Summary">
<table summary="Report summary">
<thead>
<tr>
<th style="width:75px">Total</th>
<th style="width:75px">Infos</th>
<th style="width:75px">Warnings</th>
<th style="width:75px">Errors</th>
</tr>
</thead>
<tbody>
<tr>
<td><xsl:value-of select="count(//error)" /></td>
<td><xsl:value-of select="count(//error[@severity='info'])" /></td>
<td><xsl:value-of select="count(//error[@severity='warning'])" /></td>
<td><xsl:value-of select="count(//error[@severity='error'])" /></td>
</tr>
</tbody>
</table>
</section>
<xsl:apply-templates select="." mode="display">
<xsl:with-param name="severity">error</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="display">
<xsl:with-param name="severity">warning</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="display">
<xsl:with-param name="severity">info</xsl:with-param>
</xsl:apply-templates>
</body>
</document>
</xsl:template>
<xsl:template match="/" mode="display">
<xsl:param name="severity"/>
<xsl:element name="section">
<xsl:attribute name="name">Checkstyle <xsl:value-of select="$severity"/> summary</xsl:attribute>
<table>
<tr>
<th>Error</th>
<th>Count</th>
</tr>
<xsl:for-each select="//error[@severity=$severity]" >
<xsl:sort select="@count" order="descending"/>
<xsl:sort select="@message"/>
<tr>
<td><xsl:value-of select="@message" /></td>
<td><xsl:value-of select="@count" /></td>
</tr>
</xsl:for-each>
</table>
</xsl:element>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>