the Jakarta style. Those are the stylesheets used to generate reports for audit, metrics, coverage recently sent to ant-dev git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271127 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1,3 +1,63 @@ | |||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" | |||||
xmlns:lxslt="http://xml.apache.org/xslt" | |||||
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" | |||||
extension-element-prefixes="redirect"> | |||||
<xsl:output method="html" indent="yes"/> | |||||
<xsl:decimal-format decimal-separator="." grouping-separator="," /> | |||||
<!-- | |||||
The Apache Software License, Version 1.1 | |||||
Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
reserved. | |||||
Redistribution and use in source and binary forms, with or without | |||||
modification, are permitted provided that the following conditions | |||||
are met: | |||||
1. Redistributions of source code must retain the above copyright | |||||
notice, this list of conditions and the following disclaimer. | |||||
2. Redistributions in binary form must reproduce the above copyright | |||||
notice, this list of conditions and the following disclaimer in | |||||
the documentation and/or other materials provided with the | |||||
distribution. | |||||
3. The end-user documentation included with the redistribution, if | |||||
any, must include the following acknowlegement: | |||||
"This product includes software developed by the | |||||
Apache Software Foundation (http://www.apache.org/)." | |||||
Alternately, this acknowlegement may appear in the software itself, | |||||
if and wherever such third-party acknowlegements normally appear. | |||||
4. The names "The Jakarta Project", "Ant", and "Apache Software | |||||
Foundation" must not be used to endorse or promote products derived | |||||
from this software without prior written permission. For written | |||||
permission, please contact apache@apache.org. | |||||
5. Products derived from this software may not be called "Apache" | |||||
nor may "Apache" appear in their names without prior written | |||||
permission of the Apache Group. | |||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||||
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||||
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||||
SUCH DAMAGE. | |||||
==================================================================== | |||||
This software consists of voluntary contributions made by many | |||||
individuals on behalf of the Apache Software Foundation. For more | |||||
information on the Apache Software Foundation, please see | |||||
<http://www.apache.org/>. | |||||
--> | |||||
<!-- | <!-- | ||||
Sample stylesheet to be used with JProbe 3.0 XML output. | Sample stylesheet to be used with JProbe 3.0 XML output. | ||||
@@ -9,16 +69,9 @@ | |||||
of a reference classpath so that you have the list of classes/methods | of a reference classpath so that you have the list of classes/methods | ||||
that are not used at all in a given classpath. | that are not used at all in a given classpath. | ||||
@author Stephane Bailliez <a href="sbailliez@imediation.com"/> | |||||
@author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/> | |||||
--> | --> | ||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" | |||||
xmlns:lxslt="http://xml.apache.org/xslt" | |||||
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" | |||||
extension-element-prefixes="redirect"> | |||||
<xsl:output method="html" indent="yes"/> | |||||
<xsl:decimal-format decimal-separator="." grouping-separator="," /> | |||||
<!-- default output directory is current directory --> | <!-- default output directory is current directory --> | ||||
<xsl:param name="output.dir" select="'.'"/> | <xsl:param name="output.dir" select="'.'"/> | ||||
@@ -82,39 +135,57 @@ | |||||
<!-- ======================================================================= | <!-- ======================================================================= | ||||
Stylesheet CSS used | Stylesheet CSS used | ||||
======================================================================= --> | ======================================================================= --> | ||||
<!-- this is the stylesheet css to use for nearly everything --> | |||||
<xsl:template name="stylesheet.css"> | <xsl:template name="stylesheet.css"> | ||||
BODY { | |||||
font:normal 68% verdana,arial,helvetica; | |||||
color:#000000; | |||||
} | |||||
TD { | |||||
FONT-SIZE: 68% | |||||
} | |||||
TH { | |||||
FONT-SIZE: 68%;font-weight:bold; | |||||
} | |||||
P { | |||||
line-height:1.5em; | |||||
margin-top:0.5em; margin-bottom:1.0em; | |||||
} | |||||
H1 { | |||||
MARGIN: 0px 0px 5px; FONT: 165% verdana,arial,helvetica | |||||
} | |||||
H2 { | |||||
MARGIN-TOP: 1em; MARGIN-BOTTOM: 0.5em; FONT: bold 125% verdana,arial,helvetica | |||||
} | |||||
H3 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 115% verdana,arial,helvetica | |||||
} | |||||
H4 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
H5 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
H6 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
.bannercell { | |||||
border: 0px; | |||||
padding: 0px; | |||||
} | |||||
body { | |||||
margin-left: 10; | |||||
margin-right: 10; | |||||
font:normal 80% arial,helvetica,sanserif; | |||||
background-color:#FFFFFF; | |||||
color:#000000; | |||||
} | |||||
.a td { | |||||
background: #efefef; | |||||
} | |||||
.b td { | |||||
background: #fff; | |||||
} | |||||
th, td { | |||||
text-align: left; | |||||
vertical-align: top; | |||||
} | |||||
th { | |||||
font-weight:bold; | |||||
background: #ccc; | |||||
color: black; | |||||
} | |||||
table, th, td { | |||||
font-size:100%; | |||||
border: none | |||||
} | |||||
table.log tr td, tr th { | |||||
} | |||||
h2 { | |||||
font-weight:bold; | |||||
font-size:140%; | |||||
margin-bottom: 5; | |||||
} | |||||
h3 { | |||||
font-size:100%; | |||||
font-weight:bold; | |||||
background: #525D76; | |||||
color: white; | |||||
text-decoration: none; | |||||
padding: 5px; | |||||
margin-right: 2px; | |||||
margin-left: 2px; | |||||
margin-bottom: 0; | |||||
} | |||||
</xsl:template> | </xsl:template> | ||||
<!-- ======================================================================= | <!-- ======================================================================= | ||||
@@ -128,7 +199,6 @@ | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<h2>Classes</h2> | <h2>Classes</h2> | ||||
<p> | |||||
<table width="100%"> | <table width="100%"> | ||||
<xsl:for-each select="package/class"> | <xsl:for-each select="package/class"> | ||||
<xsl:sort select="@name"/> | <xsl:sort select="@name"/> | ||||
@@ -145,7 +215,6 @@ | |||||
</tr> | </tr> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</table> | </table> | ||||
</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -159,7 +228,6 @@ | |||||
<body> | <body> | ||||
<h2><a href="overview-summary.html" target="classFrame">Home</a></h2> | <h2><a href="overview-summary.html" target="classFrame">Home</a></h2> | ||||
<h2>Packages</h2> | <h2>Packages</h2> | ||||
<p> | |||||
<table width="100%"> | <table width="100%"> | ||||
<xsl:for-each select="package"> | <xsl:for-each select="package"> | ||||
<xsl:sort select="@name" order="ascending"/> | <xsl:sort select="@name" order="ascending"/> | ||||
@@ -172,7 +240,6 @@ | |||||
</tr> | </tr> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</table> | </table> | ||||
</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -185,24 +252,24 @@ | |||||
</head> | </head> | ||||
<body onload="open('allclasses-frame.html','classListFrame')"> | <body onload="open('allclasses-frame.html','classListFrame')"> | ||||
<xsl:call-template name="pageHeader"/> | <xsl:call-template name="pageHeader"/> | ||||
<h2>Summary</h2> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<th width="10%" nowrap="nowrap">Date</th> | |||||
<th width="10%" nowrap="nowrap">Elapsed time</th> | |||||
<h3>Summary</h3> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<tr> | |||||
<!--th width="10%" nowrap="nowrap">Date</th> | |||||
<th width="10%" nowrap="nowrap">Elapsed time</th--> | |||||
<th width="10%" nowrap="nowrap">Reported Classes</th> | <th width="10%" nowrap="nowrap">Reported Classes</th> | ||||
<th width="10%" nowrap="nowrap">Methods Hit</th> | <th width="10%" nowrap="nowrap">Methods Hit</th> | ||||
<th width="10%" nowrap="nowrap">Lines Hit</th> | <th width="10%" nowrap="nowrap">Lines Hit</th> | ||||
</tr> | </tr> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<td nowrap="nowrap"><xsl:value-of select="execution_log/@program_start"/></td> | |||||
<td><xsl:value-of select="format-number(execution_log/@elapsed_time div 1000,'0.0')"/>secs</td> | |||||
<tr class="a"> | |||||
<!--td nowrap="nowrap"><xsl:value-of select="execution_log/@program_start"/></td> | |||||
<td><xsl:value-of select="format-number(execution_log/@elapsed_time div 1000,'0.0')"/>secs</td--> | |||||
<td><xsl:value-of select="count(package/class)"/></td> | <td><xsl:value-of select="count(package/class)"/></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<table border="0" width="95%"> | |||||
<table border="0" width="100%"> | |||||
<tr> | <tr> | ||||
<td style="text-align: justify;"> | <td style="text-align: justify;"> | ||||
To ensure accurate test runs on Java applications, developers need to know how much of | To ensure accurate test runs on Java applications, developers need to know how much of | ||||
@@ -214,19 +281,21 @@ | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h2>Packages</h2> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<h3>Packages</h3> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:apply-templates select="package[1]" mode="stats.header"/> | <xsl:apply-templates select="package[1]" mode="stats.header"/> | ||||
<!-- display packages and sort them via their coverage rate --> | <!-- display packages and sort them via their coverage rate --> | ||||
<xsl:for-each select="package"> | <xsl:for-each select="package"> | ||||
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | <xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><a href="{translate(@name,'.','/')}/package-summary.html"><xsl:value-of select="@name"/></a></td> | <td><a href="{translate(@name,'.','/')}/package-summary.html"><xsl:value-of select="@name"/></a></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | ||||
</tr> | </tr> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</table> | </table> | ||||
<xsl:call-template name="pageFooter"/> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -277,7 +346,6 @@ | |||||
</table> | </table> | ||||
<H2>Classes</H2> | <H2>Classes</H2> | ||||
<p> | |||||
<TABLE WIDTH="100%"> | <TABLE WIDTH="100%"> | ||||
<xsl:for-each select="class"> | <xsl:for-each select="class"> | ||||
<xsl:sort select="@name"/> | <xsl:sort select="@name"/> | ||||
@@ -288,7 +356,6 @@ | |||||
</tr> | </tr> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</TABLE> | </TABLE> | ||||
</p> | |||||
</BODY> | </BODY> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -304,24 +371,22 @@ | |||||
<!-- when loading this package, it will open the classes into the frame --> | <!-- when loading this package, it will open the classes into the frame --> | ||||
<BODY onload="open('package-frame.html','classListFrame')"> | <BODY onload="open('package-frame.html','classListFrame')"> | ||||
<xsl:call-template name="pageHeader"/> | <xsl:call-template name="pageHeader"/> | ||||
<h3>Package <xsl:value-of select="@name"/></h3> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<h3>Package <xsl:value-of select="@name"/></h3> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:apply-templates select="." mode="stats.header"/> | <xsl:apply-templates select="." mode="stats.header"/> | ||||
<xsl:apply-templates select="." mode="stats"/> | <xsl:apply-templates select="." mode="stats"/> | ||||
</table> | </table> | ||||
<xsl:if test="count(class) > 0"> | <xsl:if test="count(class) > 0"> | ||||
<H2>Classes</H2> | |||||
<p> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<H3>Classes</H3> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:apply-templates select="." mode="stats.header"/> | <xsl:apply-templates select="." mode="stats.header"/> | ||||
<xsl:apply-templates select="class" mode="stats"> | <xsl:apply-templates select="class" mode="stats"> | ||||
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | <xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
</xsl:if> | </xsl:if> | ||||
<xsl:call-template name="pageFooter"/> | |||||
</BODY> | </BODY> | ||||
</HTML> | </HTML> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -340,41 +405,59 @@ | |||||
<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3> | <H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3> | ||||
<!-- class summary --> | <!-- class summary --> | ||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:apply-templates select="." mode="stats.header"/> | <xsl:apply-templates select="." mode="stats.header"/> | ||||
<xsl:apply-templates select="." mode="stats"/> | <xsl:apply-templates select="." mode="stats"/> | ||||
</table> | </table> | ||||
<!-- details of methods --> | <!-- details of methods --> | ||||
<H2>Methods</H2> | |||||
<p> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<H3>Methods</H3> | |||||
<table class="log" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:apply-templates select="method[1]" mode="stats.header"/> | <xsl:apply-templates select="method[1]" mode="stats.header"/> | ||||
<xsl:apply-templates select="method" mode="stats"> | <xsl:apply-templates select="method" mode="stats"> | ||||
<xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | <xsl:sort data-type="number" select="cov.data/@hit_lines div cov.data/@total_lines"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
<xsl:call-template name="pageFooter"/> | |||||
</BODY> | </BODY> | ||||
</HTML> | </HTML> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- Page HEADER --> | |||||
<!-- Page Header --> | |||||
<xsl:template name="pageHeader"> | <xsl:template name="pageHeader"> | ||||
<h1>Coverage Results</h1> | |||||
<table width="100%"> | |||||
<tr> | |||||
<td align="left"></td> | |||||
<td align="right">Designed for use with <a href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td> | |||||
</tr> | |||||
</table> | |||||
<!-- jakarta logo --> | |||||
<table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||||
<tr> | |||||
<td class="bannercell" rowspan="2"> | |||||
<a href="http://jakarta.apache.org/"> | |||||
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/> | |||||
</a> | |||||
</td> | |||||
<td style="text-align:right"><h2>Source Code Coverage</h2></td> | |||||
</tr> | |||||
<tr> | |||||
<td style="text-align:right">Designed for use with <a href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td> | |||||
</tr> | |||||
</table> | |||||
<hr size="1"/> | <hr size="1"/> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- Page Footer --> | |||||
<xsl:template name="pageFooter"> | |||||
<table width="100%"> | |||||
<tr><td><hr noshade="yes" size="1"/></td></tr> | |||||
<tr><td> | |||||
<div align="center"><font color="#525D76" size="-1"><em> | |||||
Copyright © 1999-2001, Apache Software Foundation | |||||
</em></font></div> | |||||
</td></tr> | |||||
</table> | |||||
</xsl:template> | |||||
<xsl:template name="table.header"> | <xsl:template name="table.header"> | ||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<tr> | |||||
<th width="80%">Name</th> | <th width="80%">Name</th> | ||||
<th width="10%" nowrap="nowrap">Methods Hit</th> | <th width="10%" nowrap="nowrap">Methods Hit</th> | ||||
<th width="10%" nowrap="nowrap">Lines Hit</th> | <th width="10%" nowrap="nowrap">Lines Hit</th> | ||||
@@ -382,13 +465,14 @@ | |||||
</xsl:template> | </xsl:template> | ||||
<xsl:template match="method" mode="stats.header"> | <xsl:template match="method" mode="stats.header"> | ||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<tr> | |||||
<th width="90%">Name</th> | <th width="90%">Name</th> | ||||
<th width="10%" nowrap="nowrap">Lines Hit</th> | <th width="10%" nowrap="nowrap">Lines Hit</th> | ||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<xsl:template match="method" mode="stats"> | <xsl:template match="method" mode="stats"> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><xsl:value-of select="@name"/></td> | <td><xsl:value-of select="@name"/></td> | ||||
<td> | <td> | ||||
<xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/> | <xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/> | ||||
@@ -397,14 +481,15 @@ | |||||
</xsl:template> | </xsl:template> | ||||
<xsl:template match="package|class" mode="stats.header"> | <xsl:template match="package|class" mode="stats.header"> | ||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<tr> | |||||
<th width="80%">Name</th> | <th width="80%">Name</th> | ||||
<th width="10%" nowrap="nowrap">Methods Hit</th> | <th width="10%" nowrap="nowrap">Methods Hit</th> | ||||
<th width="10%" nowrap="nowrap">Lines Hit</th> | <th width="10%" nowrap="nowrap">Lines Hit</th> | ||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<xsl:template match="package|class" mode="stats"> | <xsl:template match="package|class" mode="stats"> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><xsl:value-of select="@name"/></td> | <td><xsl:value-of select="@name"/></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_methods div cov.data/@total_methods,'0.0%')"/></td> | ||||
<td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | <td><xsl:value-of select="format-number(cov.data/@hit_lines div cov.data/@total_lines,'0.0%')"/></td> | ||||
@@ -435,6 +520,14 @@ | |||||
<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK> | <LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- alternated row style --> | |||||
<xsl:template name="alternate-row"> | |||||
<xsl:attribute name="class"> | |||||
<xsl:if test="position() mod 2 = 1">a</xsl:if> | |||||
<xsl:if test="position() mod 2 = 0">b</xsl:if> | |||||
</xsl:attribute> | |||||
</xsl:template> | |||||
</xsl:stylesheet> | </xsl:stylesheet> | ||||
@@ -2,32 +2,71 @@ | |||||
xmlns:lxslt="http://xml.apache.org/xslt" | xmlns:lxslt="http://xml.apache.org/xslt" | ||||
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" | xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" | ||||
extension-element-prefixes="redirect"> | extension-element-prefixes="redirect"> | ||||
<!-- ====================================================================== | |||||
<xsl:output method="html" indent="yes"/> | |||||
<xsl:decimal-format decimal-separator="." grouping-separator="," /> | |||||
<!-- | |||||
The Apache Software License, Version 1.1 | |||||
Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
reserved. | |||||
Redistribution and use in source and binary forms, with or without | |||||
modification, are permitted provided that the following conditions | |||||
are met: | |||||
1. Redistributions of source code must retain the above copyright | |||||
notice, this list of conditions and the following disclaimer. | |||||
2. Redistributions in binary form must reproduce the above copyright | |||||
notice, this list of conditions and the following disclaimer in | |||||
the documentation and/or other materials provided with the | |||||
distribution. | |||||
3. The end-user documentation included with the redistribution, if | |||||
any, must include the following acknowlegement: | |||||
"This product includes software developed by the | |||||
Apache Software Foundation (http://www.apache.org/)." | |||||
Alternately, this acknowlegement may appear in the software itself, | |||||
if and wherever such third-party acknowlegements normally appear. | |||||
4. The names "The Jakarta Project", "Ant", and "Apache Software | |||||
Foundation" must not be used to endorse or promote products derived | |||||
from this software without prior written permission. For written | |||||
permission, please contact apache@apache.org. | |||||
5. Products derived from this software may not be called "Apache" | |||||
nor may "Apache" appear in their names without prior written | |||||
permission of the Apache Group. | |||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||||
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |||||
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||||
SUCH DAMAGE. | |||||
==================================================================== | |||||
This software consists of voluntary contributions made by many | |||||
individuals on behalf of the Apache Software Foundation. For more | |||||
information on the Apache Software Foundation, please see | |||||
<http://www.apache.org/>. | |||||
--> | |||||
<!-- | |||||
Stylesheet to transform an XML file generated by the Ant MAudit task into | Stylesheet to transform an XML file generated by the Ant MAudit task into | ||||
a set of JavaDoc-like HTML page to make pages more convenient to be browsed. | a set of JavaDoc-like HTML page to make pages more convenient to be browsed. | ||||
It use the Xalan redirect extension to write to multiple output files. | It use the Xalan redirect extension to write to multiple output files. | ||||
Note: HTML output can be made much more clean by removing non css attributes | |||||
====================================================================== --> | |||||
<xsl:output method="html" indent="yes"/> | |||||
<xsl:decimal-format decimal-separator="." grouping-separator="," /> | |||||
<!-- | |||||
Xalan redirect extension writes relative file based on the parent directory | |||||
from the main output file, unfortunately, this is never set and you have | |||||
to do it yourself on the API. The code that does it in command line was | |||||
commented out in Xalan 1.2.2 :-( | |||||
Therefore I will use a stylesheet param for the output directory. | |||||
This has to be invoked as follows from the command line: | |||||
java -classpath bsf.jar;xalan.jar;xerces.jar org.apache.xalan.xslt.Process -IN maudit.xml -XSL maudit.xsl -PARAM output.dir './report' | |||||
@author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/> | |||||
--> | --> | ||||
<xsl:param name="output.dir" select="'.'"/> | <xsl:param name="output.dir" select="'.'"/> | ||||
@@ -118,35 +157,55 @@ | |||||
<!-- this is the stylesheet css to use for nearly everything --> | <!-- this is the stylesheet css to use for nearly everything --> | ||||
<xsl:template name="stylesheet.css"> | <xsl:template name="stylesheet.css"> | ||||
BODY { | |||||
font:normal 68% verdana,arial,helvetica; | |||||
color:#000000; | |||||
} | |||||
TD { | |||||
FONT-SIZE: 68% | |||||
} | |||||
P { | |||||
line-height:1.5em; | |||||
margin-top:0.5em; margin-bottom:1.0em; | |||||
} | |||||
H1 { | |||||
MARGIN: 0px 0px 5px; FONT: 165% verdana,arial,helvetica | |||||
} | |||||
H2 { | |||||
MARGIN-TOP: 1em; MARGIN-BOTTOM: 0.5em; FONT: bold 125% verdana,arial,helvetica | |||||
} | |||||
H3 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 115% verdana,arial,helvetica | |||||
} | |||||
H4 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
H5 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
H6 { | |||||
MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica | |||||
} | |||||
.bannercell { | |||||
border: 0px; | |||||
padding: 0px; | |||||
} | |||||
body { | |||||
margin-left: 10; | |||||
margin-right: 10; | |||||
font:normal 80% arial,helvetica,sanserif; | |||||
background-color:#FFFFFF; | |||||
color:#000000; | |||||
} | |||||
.a td { | |||||
background: #efefef; | |||||
} | |||||
.b td { | |||||
background: #fff; | |||||
} | |||||
th, td { | |||||
text-align: left; | |||||
vertical-align: top; | |||||
} | |||||
th { | |||||
font-weight:bold; | |||||
background: #ccc; | |||||
color: black; | |||||
} | |||||
table, th, td { | |||||
font-size:100%; | |||||
border: none | |||||
} | |||||
table.log tr td, tr th { | |||||
} | |||||
h2 { | |||||
font-weight:bold; | |||||
font-size:140%; | |||||
margin-bottom: 5; | |||||
} | |||||
h3 { | |||||
font-size:100%; | |||||
font-weight:bold; | |||||
background: #525D76; | |||||
color: white; | |||||
text-decoration: none; | |||||
padding: 5px; | |||||
margin-right: 2px; | |||||
margin-left: 2px; | |||||
margin-bottom: 0; | |||||
} | |||||
</xsl:template> | </xsl:template> | ||||
@@ -160,25 +219,22 @@ H6 { | |||||
</xsl:call-template> | </xsl:call-template> | ||||
</HEAD> | </HEAD> | ||||
<BODY> | <BODY> | ||||
<xsl:call-template name="pageHeader"/> | |||||
<xsl:call-template name="pageHeader"/> | |||||
<H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3> | <H3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></H3> | ||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:call-template name="class.audit.header"/> | <xsl:call-template name="class.audit.header"/> | ||||
<xsl:apply-templates select="." mode="print.audit"/> | <xsl:apply-templates select="." mode="print.audit"/> | ||||
</table> | </table> | ||||
<H2>Violations</H2> | |||||
<p> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<H3>Violations</H3> | |||||
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:call-template name="violation.audit.header"/> | <xsl:call-template name="violation.audit.header"/> | ||||
<xsl:apply-templates select="./violation" mode="print.audit"> | <xsl:apply-templates select="./violation" mode="print.audit"> | ||||
<xsl:sort data-type="number" select="@line"/> | <xsl:sort data-type="number" select="@line"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
<xsl:call-template name="pageFooter"/> | |||||
</BODY> | </BODY> | ||||
</HTML> | </HTML> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -202,14 +258,12 @@ H6 { | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<H2>Classes</H2> | |||||
<p> | |||||
<h2>Classes</h2> | |||||
<TABLE WIDTH="100%"> | <TABLE WIDTH="100%"> | ||||
<xsl:apply-templates select="/classes/class[./@package = $name]" mode="classes.list"> | <xsl:apply-templates select="/classes/class[./@package = $name]" mode="classes.list"> | ||||
<xsl:sort select="@name"/> | <xsl:sort select="@name"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</TABLE> | </TABLE> | ||||
</p> | |||||
</BODY> | </BODY> | ||||
</HTML> | </HTML> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -237,13 +291,11 @@ H6 { | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<h2>Classes</h2> | <h2>Classes</h2> | ||||
<p> | |||||
<table width="100%"> | <table width="100%"> | ||||
<xsl:apply-templates select=".//class" mode="all.classes"> | <xsl:apply-templates select=".//class" mode="all.classes"> | ||||
<xsl:sort select="@name"/> | <xsl:sort select="@name"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -281,13 +333,11 @@ H6 { | |||||
<body> | <body> | ||||
<h2><a href="overview-summary.html" target="classFrame">Home</a></h2> | <h2><a href="overview-summary.html" target="classFrame">Home</a></h2> | ||||
<h2>Packages</h2> | <h2>Packages</h2> | ||||
<p> | |||||
<table width="100%"> | <table width="100%"> | ||||
<xsl:apply-templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages"> | <xsl:apply-templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages"> | ||||
<xsl:sort select="@package" order="ascending"/> | <xsl:sort select="@package" order="ascending"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -312,20 +362,20 @@ H6 { | |||||
</head> | </head> | ||||
<body onload="open('allclasses-frame.html','classListFrame')"> | <body onload="open('allclasses-frame.html','classListFrame')"> | ||||
<xsl:call-template name="pageHeader"/> | <xsl:call-template name="pageHeader"/> | ||||
<h2>Summary</h2> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<td><b>Audited classes</b></td> | |||||
<td><b>Reported classes</b></td> | |||||
<td><b>Violations</b></td> | |||||
<h3>Summary</h3> | |||||
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<tr> | |||||
<th>Audited classes</th> | |||||
<th>Reported classes</th> | |||||
<th>Violations</th> | |||||
</tr> | </tr> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr class="a"> | |||||
<td><xsl:value-of select="@audited"/></td> | <td><xsl:value-of select="@audited"/></td> | ||||
<td><xsl:value-of select="@reported"/></td> | <td><xsl:value-of select="@reported"/></td> | ||||
<td><xsl:value-of select="@violations"/></td> | <td><xsl:value-of select="@violations"/></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<table border="0" width="95%"> | |||||
<table border="0" width="100%"> | |||||
<tr> | <tr> | ||||
<td style="text-align: justify;"> | <td style="text-align: justify;"> | ||||
Note: Rules checked have originated from style guidelines suggested by the language designers, | Note: Rules checked have originated from style guidelines suggested by the language designers, | ||||
@@ -334,6 +384,8 @@ H6 { | |||||
and Metamata Audit rules (x.x). | and Metamata Audit rules (x.x). | ||||
Please consult these documents for additional information about violations. | Please consult these documents for additional information about violations. | ||||
<p/> | <p/> | ||||
Rules checked also enforce adherence to <a href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun Java coding guidelines</a> in use at Jakarta. | |||||
<p/> | |||||
One should note that these violations do not necessary underline errors but should be used | One should note that these violations do not necessary underline errors but should be used | ||||
as an indication for <i>possible</i> errors. As always, use your best judgment and review | as an indication for <i>possible</i> errors. As always, use your best judgment and review | ||||
them carefully, it might save you hours of debugging. | them carefully, it might save you hours of debugging. | ||||
@@ -341,17 +393,19 @@ H6 { | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h2>Packages</h2> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<h3>Packages</h3> | |||||
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:call-template name="class.audit.header"/> | <xsl:call-template name="class.audit.header"/> | ||||
<xsl:for-each select="class[not(./@package = preceding-sibling::class/@package)]"> | <xsl:for-each select="class[not(./@package = preceding-sibling::class/@package)]"> | ||||
<xsl:sort select="@package" order="ascending"/> | <xsl:sort select="@package" order="ascending"/> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td> | <td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of select="@package"/></a></td> | ||||
<td><xsl:value-of select="sum(/classes/class[./@package = current()/@package]/@violations)"/></td> | <td><xsl:value-of select="sum(/classes/class[./@package = current()/@package]/@violations)"/></td> | ||||
</tr> | </tr> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</table> | </table> | ||||
<xsl:call-template name="pageFooter"/> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -370,22 +424,21 @@ H6 { | |||||
<xsl:call-template name="pageHeader"/> | <xsl:call-template name="pageHeader"/> | ||||
<h3>Package <xsl:value-of select="$name"/></h3> | <h3>Package <xsl:value-of select="$name"/></h3> | ||||
<!--table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<!--table border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:call-template name="class.metrics.header"/> | <xsl:call-template name="class.metrics.header"/> | ||||
<xsl:apply-templates select="." mode="print.metrics"/> | <xsl:apply-templates select="." mode="print.metrics"/> | ||||
</table--> | </table--> | ||||
<xsl:if test="count(/classes/class[./@package = $name]) > 0"> | <xsl:if test="count(/classes/class[./@package = $name]) > 0"> | ||||
<H2>Classes</H2> | |||||
<p> | |||||
<table border="0" cellpadding="5" cellspacing="2" width="95%"> | |||||
<H3>Classes</H3> | |||||
<table class="log" border="0" cellpadding="5" cellspacing="2" width="100%"> | |||||
<xsl:call-template name="class.audit.header"/> | <xsl:call-template name="class.audit.header"/> | ||||
<xsl:apply-templates select="/classes/class[./@package = $name]" mode="print.audit"> | <xsl:apply-templates select="/classes/class[./@package = $name]" mode="print.audit"> | ||||
<xsl:sort select="@name"/> | <xsl:sort select="@name"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</table> | </table> | ||||
</p> | |||||
</xsl:if> | </xsl:if> | ||||
<xsl:call-template name="pageFooter"/> | |||||
</BODY> | </BODY> | ||||
</HTML> | </HTML> | ||||
</xsl:template> | </xsl:template> | ||||
@@ -415,51 +468,80 @@ H6 { | |||||
<LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK> | <LINK REL ="stylesheet" TYPE="text/css" TITLE="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- Page HEADER --> | <!-- Page HEADER --> | ||||
<xsl:template name="pageHeader"> | <xsl:template name="pageHeader"> | ||||
<h1>Audit Results</h1> | |||||
<table width="100%"> | |||||
<tr> | |||||
<td align="left"></td> | |||||
<td align="right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td> | |||||
</tr> | |||||
</table> | |||||
<!-- jakarta logo --> | |||||
<table border="0" cellpadding="0" cellspacing="0" width="100%"> | |||||
<tr> | |||||
<td class="bannercell" rowspan="2"> | |||||
<a href="http://jakarta.apache.org/"> | |||||
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/> | |||||
</a> | |||||
</td> | |||||
<td style="text-align:right"><h2>Source Code Audit</h2></td> | |||||
</tr> | |||||
<tr> | |||||
<td style="text-align:right">Designed for use with <a href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata Audit</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td> | |||||
</tr> | |||||
</table> | |||||
<hr size="1"/> | <hr size="1"/> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- Page HEADER --> | |||||
<xsl:template name="pageFooter"> | |||||
<table width="100%"> | |||||
<tr><td><hr noshade="yes" size="1"/></td></tr> | |||||
<tr><td> | |||||
<div align="center"><font color="#525D76" size="-1"><em> | |||||
Copyright © 1999-2001, Apache Software Foundation | |||||
</em></font></div> | |||||
</td></tr> | |||||
</table> | |||||
</xsl:template> | |||||
<!-- class header --> | <!-- class header --> | ||||
<xsl:template name="class.audit.header"> | <xsl:template name="class.audit.header"> | ||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<td width="80%"><b>Name</b></td> | |||||
<td><b>Violations</b></td> | |||||
<tr> | |||||
<th width="80%">Name</th> | |||||
<th>Violations</th> | |||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- method header --> | <!-- method header --> | ||||
<xsl:template name="violation.audit.header"> | <xsl:template name="violation.audit.header"> | ||||
<tr bgcolor="#A6CAF0" valign="top"> | |||||
<td><b>Line</b></td> | |||||
<td><b>Message</b></td> | |||||
<tr> | |||||
<th>Line</th> | |||||
<th>Message</th> | |||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- class information --> | <!-- class information --> | ||||
<xsl:template match="class" mode="print.audit"> | <xsl:template match="class" mode="print.audit"> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td> | <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td> | ||||
<td><xsl:apply-templates select="@violations"/></td> | <td><xsl:apply-templates select="@violations"/></td> | ||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<xsl:template match="violation" mode="print.audit"> | <xsl:template match="violation" mode="print.audit"> | ||||
<tr bgcolor="#EEEEE" valign="top"> | |||||
<tr> | |||||
<xsl:call-template name="alternate-row"/> | |||||
<td><xsl:value-of select="@line"/></td> | <td><xsl:value-of select="@line"/></td> | ||||
<td><xsl:apply-templates select="@message"/></td> | <td><xsl:apply-templates select="@message"/></td> | ||||
</tr> | </tr> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- alternated row style --> | |||||
<xsl:template name="alternate-row"> | |||||
<xsl:attribute name="class"> | |||||
<xsl:if test="position() mod 2 = 1">a</xsl:if> | |||||
<xsl:if test="position() mod 2 = 0">b</xsl:if> | |||||
</xsl:attribute> | |||||
</xsl:template> | |||||
</xsl:stylesheet> | </xsl:stylesheet> | ||||