|
Line 0
Link Here
|
|
|
1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
- $Header$ |
| 5 |
- |
| 6 |
- XSL template for PMD results reporting inside of CruiseControl. |
| 7 |
- |
| 8 |
- Copyright (C) 2005 Christopher G. Stach II <cgs@ldsys.net> |
| 9 |
- |
| 10 |
- This program is free software; you can redistribute it and/or |
| 11 |
- modify it under the terms of the GNU General Public License |
| 12 |
- as published by the Free Software Foundation; either version 2 |
| 13 |
- of the License, or (at your option) any later version. |
| 14 |
- |
| 15 |
- This program is distributed in the hope that it will be useful, |
| 16 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
- GNU General Public License for more details. |
| 19 |
- |
| 20 |
- You should have received a copy of the GNU General Public License |
| 21 |
- along with this program; if not, write to the Free Software |
| 22 |
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 23 |
--> |
| 24 |
|
| 25 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> |
| 26 |
<xsl:output method="html" /> |
| 27 |
|
| 28 |
<xsl:template match="/" mode="pmd"> |
| 29 |
<xsl:apply-templates select="cruisecontrol/pmd" mode="pmd" /> |
| 30 |
</xsl:template> |
| 31 |
|
| 32 |
<xsl:template match="pmd[file/violation]" mode="pmd"> |
| 33 |
<xsl:variable name="total.violation.count" select="count(file/violation)" /> |
| 34 |
<table align="center" cellpadding="2" cellspacing="0" border="0" width="98%"> |
| 35 |
<tr> |
| 36 |
<td class="pmd-sectionheader">PMD violations (<xsl:value-of select="$total.violation.count" />)</td> |
| 37 |
</tr> |
| 38 |
<tr> |
| 39 |
<td><table width="100%"> |
| 40 |
<xsl:for-each select="file"> |
| 41 |
<xsl:sort select="@name" /> |
| 42 |
<tr class="pmd-fileheader"> |
| 43 |
<td colspan="5"><xsl:value-of select="@name" /> (<xsl:value-of select="count(violation)" />)</td> |
| 44 |
</tr> |
| 45 |
<xsl:for-each select="violation"> |
| 46 |
<xsl:sort select="@line" data-type="number" /> |
| 47 |
<xsl:sort select="@priority" data-type="number" order="descending" /> |
| 48 |
<tr> |
| 49 |
<xsl:if test="position() mod 2 = 0"> |
| 50 |
<xsl:attribute name="class">pmd-evenrow</xsl:attribute> |
| 51 |
</xsl:if> |
| 52 |
<xsl:if test="position() mod 2 = 1"> |
| 53 |
<xsl:attribute name="class">pmd-oddrow</xsl:attribute> |
| 54 |
</xsl:if> |
| 55 |
<td width="10"> |
| 56 |
<xsl:attribute name="class">pmd-priority-<xsl:value-of select="@priority" /></xsl:attribute> |
| 57 |
  |
| 58 |
</td> |
| 59 |
<td>Line <xsl:value-of select="@line" /></td> |
| 60 |
<td><xsl:value-of select="text()" /></td> |
| 61 |
<td><xsl:value-of select="@ruleset" /></td> |
| 62 |
<td><xsl:value-of select="@rule" /></td> |
| 63 |
</tr> |
| 64 |
</xsl:for-each> |
| 65 |
</xsl:for-each> |
| 66 |
</table></td> |
| 67 |
</tr> |
| 68 |
</table> |
| 69 |
</xsl:template> |
| 70 |
|
| 71 |
<xsl:template match="/"> |
| 72 |
<xsl:apply-templates select="." mode="pmd" /> |
| 73 |
</xsl:template> |
| 74 |
|
| 75 |
</xsl:stylesheet> |
| 76 |
|