5713N/A<?xml version="1.0"?>
0N/A<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
0N/A xmlns:lxslt="http://xml.apache.org/xslt"
0N/A xmlns:redirect="org.apache.xalan.lib.Redirect"
0N/A extension-element-prefixes="redirect">
0N/A<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
0N/A<!--
809N/A Licensed to the Apache Software Foundation (ASF) under one or more
809N/A contributor license agreements. See the NOTICE file distributed with
809N/A this work for additional information regarding copyright ownership.
809N/A The ASF licenses this file to You under the Apache License, Version 2.0
809N/A (the "License"); you may not use this file except in compliance with
809N/A the License. You may obtain a copy of the License at
809N/A
809N/A http://www.apache.org/licenses/LICENSE-2.0
809N/A
809N/A Unless required by applicable law or agreed to in writing, software
809N/A distributed under the License is distributed on an "AS IS" BASIS,
809N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809N/A See the License for the specific language governing permissions and
809N/A limitations under the License.
0N/A
0N/A-->
0N/A<!--
0N/A
0N/A Sample stylesheet to be used with JDepend XML output.
0N/A
0N/A It creates a set of HTML files a la javadoc where you can browse easily
0N/A through all packages and classes.
0N/A
0N/A @author <a href="mailto:jtulley@novell.com">Jeff Tulley</a>
0N/A
0N/A -->
0N/A<xsl:param name="output.dir" select="'.'"/>
0N/A
0N/A<xsl:template match="JDepend">
0N/A <!-- create the index.html -->
0N/A <redirect:write file="{$output.dir}/index.html">
0N/A <xsl:call-template name="index.html"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the stylesheet.css -->
0N/A <redirect:write file="{$output.dir}/stylesheet.css">
0N/A <xsl:call-template name="stylesheet.css"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the overview-packages.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-summary.html">
0N/A <xsl:apply-templates select="." mode="overview.packages"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the overview-packages.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-packages.html">
0N/A <xsl:apply-templates select="." mode="packages.details"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the overview-cycles.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-cycles.html">
0N/A <xsl:apply-templates select="." mode="cycles.details"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the overview-cycles.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-explanations.html">
0N/A <xsl:apply-templates select="." mode="explanations"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the all-packages.html at the root -->
0N/A <redirect:write file="{$output.dir}/all-packages.html">
0N/A <xsl:apply-templates select="Packages" mode="all.packages"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the all-cycles.html at the root -->
0N/A <redirect:write file="{$output.dir}/all-cycles.html">
0N/A <xsl:apply-templates select="Cycles" mode="all.cycles"/>
0N/A </redirect:write>
0N/A</xsl:template>
0N/A
0N/A
0N/A<xsl:template name="index.html">
0N/A<html>
0N/A <head>
0N/A <title>JDepend Analysis</title>
0N/A </head>
0N/A <frameset cols="20%,80%">
0N/A <frameset rows="30%,70%">
0N/A <frame src="all-packages.html" name="packageListFrame"/>
0N/A <frame src="all-cycles.html" name="classListFrame"/>
0N/A </frameset>
0N/A <frame src="overview-summary.html" name="classFrame"/>
0N/A </frameset>
0N/A <noframes>
0N/A <h2>Frame Alert</h2>
0N/A <p>
0N/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.
0N/A </p>
0N/A </noframes>
0N/A</html>
0N/A</xsl:template>
0N/A
0N/A<!-- this is the stylesheet css to use for nearly everything -->
0N/A<xsl:template name="stylesheet.css">
0N/A <style type="text/css">
0N/A body {
0N/A font:normal 68% verdana,arial,helvetica;
0N/A color:#000000;
0N/A }
0N/A table tr td, tr th {
0N/A font-size: 68%;
0N/A }
0N/A table.details tr th{
0N/A font-weight: bold;
0N/A text-align:left;
0N/A background:#a6caf0;
0N/A }
0N/A table.details tr td{
0N/A background:#eeeee0;
0N/A }
0N/A
0N/A p {
0N/A line-height:1.5em;
0N/A margin-top:0.5em; margin-bottom:1.0em;
0N/A margin-left:2em;
0N/A margin-right:2em;
0N/A }
0N/A h1 {
0N/A margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
0N/A }
0N/A h2 {
0N/A margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
0N/A }
0N/A h3 {
0N/A margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
0N/A }
0N/A h4 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A }
0N/A h5 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A }
0N/A h6 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A }
0N/A .Error {
0N/A font-weight:bold; color:red;
0N/A }
0N/A .Failure {
0N/A font-weight:bold; color:purple;
0N/A }
0N/A .Properties {
0N/A text-align:right;
0N/A }
0N/A </style>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend" mode="overview.packages">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <table width="100%"><tr align="left"><h2>Summary</h2><td>
0N/A </td><td align="right">
0N/A [summary]
0N/A [<a href="overview-packages.html">packages</a>]
0N/A [<a href="overview-cycles.html">cycles</a>]
0N/A [<a href="overview-explanations.html">explanations</a>]
0N/A </td></tr></table>
0N/A <table width="100%" class="details">
0N/A <tr>
0N/A <th>Package</th>
0N/A <th>Total Classes</th>
0N/A <th><a href="overview-explanations.html#EXnumber">Abstract Classes</a></th>
0N/A <th><a href="overview-explanations.html#EXnumber">Concrete Classes</a></th>
0N/A <th><a href="overview-explanations.html#EXafferent">Afferent Couplings</a></th>
0N/A <th><a href="overview-explanations.html#EXefferent">Efferent Couplings</a></th>
0N/A <th><a href="overview-explanations.html#EXabstractness">Abstractness</a></th>
0N/A <th><a href="overview-explanations.html#EXinstability">Instability</a></th>
0N/A <th><a href="overview-explanations.html#EXdistance">Distance</a></th>
0N/A
0N/A </tr>
0N/A <xsl:for-each select="/Packages/Package">
0N/A <xsl:if test="count(error) = 0">
0N/A <tr>
0N/A <td align="left">
0N/A <a>
0N/A <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="@name"/>
0N/A </xsl:attribute>
0N/A <xsl:value-of select="@name"/>
0N/A </a>
0N/A </td>
0N/A <td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/Ca"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/Ce"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/A"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/I"/></td>
0N/A <td align="right"><xsl:value-of select="Stats/D"/></td>
0N/A </tr>
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A <xsl:for-each select="/Packages/Package">
0N/A <xsl:if test="count(error) &gt; 0">
0N/A <tr>
0N/A <td align="left">
0N/A <xsl:value-of select="@name"/>
0N/A </td>
0N/A <td align="left" colspan="8"><xsl:value-of select="error"/></td>
0N/A </tr>
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend" mode="packages.details">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <table width="100%"><tr align="left"><h2>Packages</h2><td>
0N/A </td><td align="right">
0N/A [<a href="overview-summary.html">summary</a>]
0N/A [packages]
0N/A [<a href="overview-cycles.html">cycles</a>]
0N/A [<a href="overview-explanations.html">explanations</a>]
0N/A </td></tr></table>
0N/A
0N/A <xsl:for-each select="/Packages/Package">
0N/A <xsl:if test="count(error) = 0">
0N/A <h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
0N/A <xsl:value-of select="@name"/></a></h3>
0N/A
0N/A <table width="100%"><tr>
0N/A <td><a href="overview-explanations.html#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
0N/A <td><a href="overview-explanations.html#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
0N/A <td><a href="overview-explanations.html#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
0N/A <td><a href="overview-explanations.html#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
0N/A <td><a href="overview-explanations.html#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
0N/A </tr></table>
0N/A
0N/A <table width="100%" class="details">
0N/A <tr>
0N/A <th>Abstract Classes</th>
0N/A <th>Concrete Classes</th>
0N/A <th>Used by Packages</th>
0N/A <th>Uses Packages</th>
0N/A </tr>
0N/A <tr>
0N/A <td valign="top" width="25%">
0N/A <xsl:if test="count(AbstractClasses/Class)=0">
0N/A <i>None</i>
0N/A </xsl:if>
0N/A <xsl:for-each select="AbstractClasses/Class">
0N/A <xsl:value-of select="node()"/><br/>
0N/A </xsl:for-each>
0N/A </td>
0N/A <td valign="top" width="25%">
0N/A <xsl:if test="count(ConcreteClasses/Class)=0">
0N/A <i>None</i>
0N/A </xsl:if>
0N/A <xsl:for-each select="ConcreteClasses/Class">
0N/A <xsl:value-of select="node()"/><br/>
0N/A </xsl:for-each>
0N/A </td>
0N/A <td valign="top" width="25%">
0N/A <xsl:if test="count(UsedBy/Package)=0">
0N/A <i>None</i>
0N/A </xsl:if>
0N/A <xsl:for-each select="UsedBy/Package">
0N/A <a>
0N/A <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="node()"/></xsl:attribute>
0N/A <xsl:value-of select="node()"/>
0N/A </a><br/>
0N/A </xsl:for-each>
0N/A </td>
0N/A <td valign="top" width="25%">
0N/A <xsl:if test="count(DependsUpon/Package)=0">
0N/A <i>None</i>
0N/A </xsl:if>
0N/A <xsl:for-each select="DependsUpon/Package">
0N/A <a>
0N/A <xsl:attribute name="href">overview-packages.html#PK<xsl:value-of select="node()"/></xsl:attribute>
0N/A <xsl:value-of select="node()"/>
0N/A </a><br/>
0N/A </xsl:for-each>
0N/A </td>
0N/A </tr>
0N/A </table>
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A <!-- this is often a long listing; provide a lower navigation table also -->
0N/A <table width="100%"><tr align="left"><td></td><td align="right">
0N/A [<a href="overview-summary.html">summary</a>]
0N/A [packages]
0N/A [<a href="overview-cycles.html">cycles</a>]
0N/A [<a href="overview-explanations.html">explanations</a>]
0N/A </td></tr></table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend" mode="cycles.details">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <table width="100%"><tr align="left"><h2>Cycles</h2><td>
0N/A </td><td align="right">
0N/A [<a href="overview-summary.html">summary</a>]
0N/A [<a href="overview-packages.html">packages</a>]
0N/A [cycles]
0N/A [<a href="overview-explanations.html">explanations</a>]
0N/A </td></tr></table>
0N/A <!--<table width="100%"><tr><td>
0N/A </td><td align="right">
0N/A [<a href="#NVsummary">summary</a>]
0N/A [<a href="#NVpackages">packages</a>]
0N/A [<a href="#NVcycles">cycles</a>]
0N/A [<a href="#NVexplanations">explanations</a>]
0N/A </td></tr></table> -->
0N/A
0N/A <xsl:if test="count(Cycles/Package) = 0">
0N/A <p>There are no cyclic dependancies.</p>
0N/A </xsl:if>
0N/A <xsl:for-each select="Cycles/Package">
0N/A <h3><a><xsl:attribute name="name">#CY<xsl:value-of select="@Name"/></xsl:attribute><xsl:value-of select="@Name"/></a></h3><p>
0N/A <xsl:for-each select="Package">
0N/A <xsl:value-of select="."/><br/>
0N/A </xsl:for-each></p>
0N/A </xsl:for-each>
0N/A <!-- this is often a long listing; provide a lower navigation table also -->
0N/A <table width="100%"><tr align="left"><td></td><td align="right">
0N/A [<a href="overview-summary.html">summary</a>]
0N/A [<a href="overview-packages.html">packages</a>]
0N/A [cycles]
0N/A [<a href="overview-explanations.html">explanations</a>]
0N/A </td></tr></table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend" mode="explanations">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <xsl:call-template name="pageHeader"/>
0N/A
0N/A <table width="100%"><tr align="left"><h2>Explanations</h2><td>
0N/A </td><td align="right">
0N/A [<a href="overview-summary.html">summary</a>]
0N/A [<a href="overview-packages.html">packages</a>]
0N/A [<a href="overview-cycles.html">cycles</a>]
0N/A [explanations]
0N/A </td></tr></table>
0N/A
0N/A <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>
0N/A
0N/A <h3><a name="EXnumber">Number of Classes</a></h3>
0N/A <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
0N/A <h3><a name="EXafferent">Afferent Couplings</a></h3>
0N/A <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
0N/A <h3><a name="EXefferent">Efferent Couplings</a></h3>
0N/A <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
0N/A <h3><a name="EXabstractness">Abstractness</a></h3>
0N/A <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>
0N/A <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>
0N/A <h3><a name="EXinstability">Instability</a></h3>
0N/A <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>
0N/A <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>
0N/A <h3><a name="EXdistance">Distance</a></h3>
0N/A <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>
0N/A <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>
0N/A <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>
0N/A
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!--
0N/ACreates an html file that contains a link to all package links in overview-packages.html.
0N/A @bug there will be a problem here, I don't know yet how to handle unnamed package :(
0N/A-->
0N/A<xsl:template match="JDepend/Packages" mode="all.packages">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
0N/A [<a href="overview-summary.html" target="classFrame">summary</a>]
0N/A [<a href="overview-packages.html" target="classFrame">packages</a>]
0N/A [<a href="overview-cycles.html" target="classFrame">cycles</a>]
0N/A [<a href="overview-explanations.html" target="classFrame">explanations</a>]
0N/A </td></tr></table>
0N/A <h2>Packages</h2>
0N/A <table width="100%">
0N/A <xsl:apply-templates select="Package[count(error)=0]" mode="all.packages.link">
0N/A <xsl:sort select="@name"/>
0N/A </xsl:apply-templates>
0N/A <xsl:apply-templates select="Package[count(error) &gt; 0]" mode="all.packages.nolink">
0N/A <xsl:sort select="@name"/>
0N/A </xsl:apply-templates>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend/Packages/Package" mode="all.packages.link">
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <a href="overview-packages.html#PK{@name}" target="classFrame">
0N/A <xsl:value-of select="@name"/>
0N/A </a>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A<!--
0N/AI do not know JDepend enough to know if every error results in a non-analyzed package,
0N/Abut that is how I am presenting it to the viewer. This may need to change.
0N/A @bug there will be a problem here, I don't know yet how to handle unnamed package :(
0N/A-->
0N/A<xsl:template match="JDepend/Packages/Package" mode="all.packages.nolink">
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A Not Analyzed: <xsl:value-of select="@name"/>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A<!--
0N/ACreates an html file that contains a link to all package links in overview-cycles.html.
0N/A @bug there will be a problem here, I don't know yet how to handle unnamed package :(
0N/A-->
0N/A<xsl:template match="JDepend/Cycles" mode="all.cycles">
0N/A <html>
0N/A <head>
0N/A <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
0N/A </head>
0N/A <body>
0N/A <table width="100%"><tr align="left"><td></td><td nowrap="nowrap" align="right">
0N/A [<a href="overview-summary.html" target="classFrame">summary</a>]
0N/A [<a href="overview-packages.html" target="classFrame">packages</a>]
0N/A [<a href="overview-cycles.html" target="classFrame">cycles</a>]
0N/A [<a href="overview-explanations.html" target="classFrame">explanations</a>]
0N/A </td></tr></table>
0N/A <h2>Cycles</h2>
0N/A <table width="100%">
0N/A <xsl:apply-templates select="Package" mode="all.cycles">
0N/A <xsl:sort select="@Name"/>
0N/A </xsl:apply-templates>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="JDepend/Cycles/Package" mode="all.cycles">
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <a href="overview-cycles.html#CY{@Name}" target="classFrame"><xsl:value-of select="@Name"/></a>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A<!-- Page HEADER -->
0N/A<xsl:template name="pageHeader">
0N/A <h1>JDepend Analysis</h1>
0N/A <table width="100%">
0N/A <tr>
0N/A <td align="left"></td>
0N/A <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>
0N/A </tr>
0N/A </table>
0N/A <hr size="1"/>
0N/A</xsl:template>
0N/A
0N/A</xsl:stylesheet>