10139N/A extension-
element-
prefixes="redirect">
10139N/A<
xsl:
output method="html" indent="yes" encoding="US-ASCII"/>
10139N/A<
xsl:
decimal-
format decimal-
separator="." grouping-
separator="," />
10139N/A Licensed to the Apache Software Foundation (ASF) under one or more 10139N/A contributor license agreements. See the NOTICE file distributed with 10139N/A this work for additional information regarding copyright ownership. 11026N/A The ASF licenses this file to You under the Apache License, Version 2.0 10139N/A (the "License"); you may not use this file except in compliance with 10139N/A the License. You may obtain a copy of the License at 10139N/A Unless required by applicable law or agreed to in writing, software 11027N/A distributed under the License is distributed on an "AS IS" BASIS, 10139N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10139N/A See the License for the specific language governing permissions and 10139N/A Stylesheet to transform an XML file generated by the Ant MAudit task into 10139N/A a set of JavaDoc-like HTML page to make pages more convenient to be browsed. 10139N/A It use the Xalan redirect extension to write to multiple output files. 10139N/A @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/> 10139N/A <
xsl:
for-
each select="/class[not(./@package = preceding-sibling::class/@package)]">
10139N/A <
xsl:
call-
template name="package">
10139N/A <
xsl:
with-
param name="name" select="@package"/>
10139N/A <
xsl:
if test="not($name = '')"><
xsl:
value-
of select="translate($name,'.','/')"/></
xsl:
if>
10139N/A <
xsl:
if test="$name = ''">.</
xsl:
if>
10139N/A <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> --> 10139N/A <
xsl:
with-
param name="name" select="$name"/>
10139N/A <
xsl:
with-
param name="name" select="$name"/>
10139N/A <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten --> 10139N/A <
HEAD><
TITLE>Audit Results.</
TITLE></
HEAD>
11026N/A This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
10917N/A<!-- this is the stylesheet css to use for nearly everything --> 10295N/A font:normal 80% arial,helvetica,sanserif;
10139N/A<!-- print the violations of the class --> 10139N/A <
xsl:
call-
template name="pageHeader"/>
10139N/A <
table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
10139N/A <
table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
10139N/A <
xsl:
sort data-
type="number" select="@line"/>
10139N/A <
xsl:
call-
template name="pageFooter"/>
<!-- list of classes in a package --> <
xsl:
sort select="@name"/>
<!-- the class to list --> <!-- @bug naming to fix for inner classes --> <
a href="{@name}.html" target="classFrame"><
xsl:
value-
of select="@name"/></
a>
<
xsl:
apply-
templates select=".//class" mode="all.classes">
<
xsl:
sort select="@name"/>
<!-- (ancestor::package)[last()] is buggy in MSXML3 ? --> <
xsl:
attribute name="href">
<
xsl:
value-
of select="translate($package.name,'.','/')"/><
xsl:
text>/</
xsl:
text>
</
xsl:
if><
xsl:
value-
of select="@name"/><
xsl:
text>.html</
xsl:
text>
<
xsl:
value-
of select="@name"/>
each package existing on testsuites. @bug there will be a problem here, I don't know yet how to handle unnamed package :( <
xsl:
apply-
templates select="class[not(./@package = preceding-sibling::class/@package)]" mode="all.packages">
<
xsl:
sort select="@package" order="ascending"/>
<
xsl:
value-
of select="@package"/>
<
xsl:
call-
template name="pageHeader"/>
<
table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<
th>Reported classes</
th>
<
td><
xsl:
value-
of select="@audited"/></
td>
<
td><
xsl:
value-
of select="@reported"/></
td>
<
td><
xsl:
value-
of select="@violations"/></
td>
<
table border="0" width="100%">
<
td style="text-align: justify;">
Note: Rules checked have originated from style guidelines suggested by the language designers,
experience from the Java development community and insite experience. Violations are generally
and Metamata Audit rules (
x.x).
Please consult these documents for additional information about violations.
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
them carefully, it might save you hours of debugging.
<
table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<
xsl:
for-
each select="class[not(./@package = preceding-sibling::class/@package)]">
<
xsl:
sort select="@package" order="ascending"/>
<
xsl:
call-
template name="alternate-row"/>
<
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>
<
xsl:
call-
template name="pageFooter"/>
<
xsl:
call-
template name="pageHeader"/>
<
h3>Package <
xsl:
value-
of select="$name"/></
h3>
<!--table border="0" cellpadding="5" cellspacing="2" width="100%"> <
xsl:
if test="count(/classes/class[./@package = $name]) > 0">
<
table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
<
xsl:
sort select="@name"/>
<
xsl:
call-
template name="pageFooter"/>
transform string like a.b.c to ../../../ @param path the path to transform into a descending directory path <
xsl:
template name="path">
<
xsl:
if test="contains($path,'.')">
<
xsl:
call-
template name="path">
<
xsl:
with-
param name="path"><
xsl:
value-
of select="substring-after($path,'.')"/></
xsl:
with-
param>
<
xsl:
if test="not(contains($path,'.')) and not($path = '')">
<!-- create the link to the stylesheet based on the package name --> <
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 name="pageHeader">
<
table border="0" cellpadding="0" cellspacing="0" width="100%">
<
td class="bannercell" rowspan="2">
<
td style="text-align:right"><
h2>Source Code Audit</
h2></
td>
<
xsl:
template name="pageFooter">
<
th width="80%">Name</
th>
<!-- class information --> <
xsl:
call-
template name="alternate-row"/>
<
td><
a href="{@name}.html"><
xsl:
value-
of select="@name"/></
a></
td>
<
td><
xsl:
apply-
templates select="@violations"/></
td>
<
xsl:
call-
template name="alternate-row"/>
<
td><
xsl:
value-
of select="@line"/></
td>
<
td><
xsl:
apply-
templates select="@message"/></
td>
<!-- 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>