<?xml version="1.0"?>
xmlns:lxslt="http://xml.apache.org/xslt"
extension-element-prefixes="redirect">
<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
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.
-->
<!--
Sample stylesheet to be used with JDepend XML output.
It creates a set of HTML files a la javadoc where you can browse easily
through all packages and classes.
@author <a href="mailto:jtulley@novell.com">Jeff Tulley</a>
-->
<xsl:template match="JDepend">
<!-- create the index.html -->
</redirect:write>
<!-- create the stylesheet.css -->
</redirect:write>
<!-- create the overview-packages.html at the root -->
</redirect:write>
<!-- create the overview-packages.html at the root -->
</redirect:write>
<!-- create the overview-cycles.html at the root -->
</redirect:write>
<!-- create the overview-cycles.html at the root -->
<xsl:apply-templates select="." mode="explanations"/>
</redirect:write>
<!-- create the all-packages.html at the root -->
</redirect:write>
<!-- create the all-cycles.html at the root -->
</redirect:write>
</xsl:template>
<html>
<head>
<title>JDepend Analysis</title>
</head>
<frameset cols="20%,80%">
<frameset rows="30%,70%">
</frameset>
</frameset>
<noframes>
<h2>Frame Alert</h2>
<p>
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.
</p>
</noframes>
</html>
</xsl:template>
<!-- this is the stylesheet css to use for nearly everything -->
body {
font:normal 68% verdana,arial,helvetica;
color:#000000;
}
table tr td, tr th {
font-size: 68%;
}
table.details tr th{
font-weight: bold;
text-align:left;
background:#a6caf0;
}
table.details tr td{
background:#eeeee0;
}
p {
line-height:1.5em;
margin-top:0.5em; margin-bottom:1.0em;
margin-left:2em;
margin-right:2em;
}
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
}
.Error {
font-weight:bold; color:red;
}
.Failure {
font-weight:bold; color:purple;
}
.Properties {
text-align:right;
}
</style>
</xsl:template>
<html>
<head>
</head>
<body>
<xsl:call-template name="pageHeader"/>
<table width="100%"><tr align="left"><h2>Summary</h2><td>
</td><td align="right">
[summary]
</td></tr></table>
<table width="100%" class="details">
<tr>
<th>Package</th>
<th>Total Classes</th>
</tr>
<xsl:if test="count(error) = 0">
<tr>
<td align="left">
<a>
</xsl:attribute>
<xsl:value-of select="@name"/>
</a>
</td>
<td align="right"><xsl:value-of select="Stats/A"/></td>
<td align="right"><xsl:value-of select="Stats/I"/></td>
<td align="right"><xsl:value-of select="Stats/D"/></td>
</tr>
</xsl:if>
</xsl:for-each>
<xsl:if test="count(error) > 0">
<tr>
<td align="left">
<xsl:value-of select="@name"/>
</td>
<td align="left" colspan="8"><xsl:value-of select="error"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<html>
<head>
</head>
<body>
<xsl:call-template name="pageHeader"/>
<table width="100%"><tr align="left"><h2>Packages</h2><td>
</td><td align="right">
[packages]
</td></tr></table>
<xsl:if test="count(error) = 0">
<h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
<xsl:value-of select="@name"/></a></h3>
<table width="100%"><tr>
<td><a href="overview-explanations.html#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
<td><a href="overview-explanations.html#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
<td><a href="overview-explanations.html#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
<td><a href="overview-explanations.html#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
<td><a href="overview-explanations.html#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
</tr></table>
<table width="100%" class="details">
<tr>
<th>Abstract Classes</th>
<th>Concrete Classes</th>
<th>Used by Packages</th>
<th>Uses Packages</th>
</tr>
<tr>
<td valign="top" width="25%">
<i>None</i>
</xsl:if>
<xsl:value-of select="node()"/><br/>
</xsl:for-each>
</td>
<td valign="top" width="25%">
<i>None</i>
</xsl:if>
<xsl:value-of select="node()"/><br/>
</xsl:for-each>
</td>
<td valign="top" width="25%">
<i>None</i>
</xsl:if>
<a>
<xsl:value-of select="node()"/>
</a><br/>
</xsl:for-each>
</td>
<td valign="top" width="25%">
<i>None</i>
</xsl:if>
<a>
<xsl:value-of select="node()"/>
</a><br/>
</xsl:for-each>
</td>
</tr>
</table>
</xsl:if>
</xsl:for-each>
<!-- this is often a long listing; provide a lower navigation table also -->
<table width="100%"><tr align="left"><td></td><td align="right">
[packages]
</td></tr></table>
</body>
</html>
</xsl:template>
<html>
<head>
</head>
<body>
<xsl:call-template name="pageHeader"/>
<table width="100%"><tr align="left"><h2>Cycles</h2><td>
</td><td align="right">
[cycles]
</td></tr></table>
<!--<table width="100%"><tr><td>
</td><td align="right">
[<a href="#NVsummary">summary</a>]
[<a href="#NVpackages">packages</a>]
[<a href="#NVcycles">cycles</a>]
[<a href="#NVexplanations">explanations</a>]
</td></tr></table> -->
<p>There are no cyclic dependancies.</p>
</xsl:if>
<h3><a><xsl:attribute name="name">#CY<xsl:value-of select="@Name"/></xsl:attribute><xsl:value-of select="@Name"/></a></h3><p>
<xsl:for-each select="Package">
<xsl:value-of select="."/><br/>
</xsl:for-each></p>
</xsl:for-each>
<!-- this is often a long listing; provide a lower navigation table also -->
<table width="100%"><tr align="left"><td></td><td align="right">
[cycles]
</td></tr></table>
</body>
</html>
</xsl:template>
<xsl:template match="JDepend" mode="explanations">
<html>
<head>
</head>
<body>
<xsl:call-template name="pageHeader"/>
<table width="100%"><tr align="left"><h2>Explanations</h2><td>
</td><td align="right">
[explanations]
</td></tr></table>
<p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
<h3><a name="EXnumber">Number of Classes</a></h3>
<p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
<h3><a name="EXafferent">Afferent Couplings</a></h3>
<p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
<h3><a name="EXefferent">Efferent Couplings</a></h3>
<p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
<h3><a name="EXabstractness">Abstractness</a></h3>
<p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
<p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
<h3><a name="EXinstability">Instability</a></h3>
<p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
<p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
<h3><a name="EXdistance">Distance</a></h3>
<p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
<p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
<p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
</body>
</html>
</xsl:template>
<!--
Creates an html file that contains a link to all package links in overview-packages.html.
@bug there will be a problem here, I don't know yet how to handle unnamed package :(
-->
<html>
<head>
</head>
<body>
<table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
</td></tr></table>
<h2>Packages</h2>
<table width="100%">
<xsl:sort select="@name"/>
</xsl:apply-templates>
<xsl:sort select="@name"/>
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<tr>
<td nowrap="nowrap">
<xsl:value-of select="@name"/>
</a>
</td>
</tr>
</xsl:template>
<!--
I do not know JDepend enough to know if every error results in a non-analyzed package,
but that is how I am presenting it to the viewer. This may need to change.
@bug there will be a problem here, I don't know yet how to handle unnamed package :(
-->
<tr>
<td nowrap="nowrap">
Not Analyzed: <xsl:value-of select="@name"/>
</td>
</tr>
</xsl:template>
<!--
Creates an html file that contains a link to all package links in overview-cycles.html.
@bug there will be a problem here, I don't know yet how to handle unnamed package :(
-->
<html>
<head>
</head>
<body>
<table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
</td></tr></table>
<h2>Cycles</h2>
<table width="100%">
<xsl:sort select="@Name"/>
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<tr>
<td nowrap="nowrap">
</td>
</tr>
</xsl:template>
<!-- Page HEADER -->
<xsl:template name="pageHeader">
<h1>JDepend Analysis</h1>
<table width="100%">
<tr>
<td align="left"></td>
<td align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</td>
</tr>
</table>
<hr size="1"/>
</xsl:template>
</xsl:stylesheet>