Files
maven-plugins/linkcheck/src/plugin-resources/linkcheck.jsl
T
2006-03-11 17:14:46 +00:00

85 lines
4.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
* ========================================================================
*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*
* ========================================================================
-->
<jsl:stylesheet
select="$doc"
xmlns:j="jelly:core"
xmlns:util="jelly:util"
xmlns:jsl="jelly:jsl"
xmlns:x="jelly:xml"
xmlns="dummy"
trim="false">
<jsl:template match="linkcheck">
<document>
<properties>
<title>Link Check Report</title>
</properties>
<body>
<section name="Link Check Report">
<p><b><span style="color:#00AA00;text-align:right"><x:expr select="count(file)"/> </span></b> file(s) and <b><span style="color:#00AA00;text-align:right"><x:expr select="sum(file/unsuccessful)+sum(file/successful)"/> </span></b> link(s) checked. <b><span style="color:#FF0000;text-align:right"><x:expr select="count(file/result[status='error'])"/></span></b> error(s) and <b><span style="color:#FFA916;text-align:right"><x:expr select="count(file/result[status='warning'])"/></span></b> warning(s) reported in <b><span style="color:#00AA00;text-align:right"><x:expr select="count(file[unsuccessful!=0])"/> </span></b> file(s).</p>
<j:set var="nbFilesInError"><x:expr select="count(file[unsuccessful!=0])"/></j:set>
<j:if test="${nbFilesInError gt 0}">
<table summary="Link Check summary">
<thead>
<tr>
<th rowspan="2">Document</th>
<th colspan="4">links</th>
</tr>
<tr>
<th width="50">total</th>
<th width="50"><img align="right" src="images/icon_valid_sml.gif" alt="success"/></th>
<th width="50"><img align="right" src="images/icon_warning_sml.gif" alt="warning"/></th>
<th width="50"><img align="right" src="images/icon_error_sml.gif" alt="error"/></th>
</tr>
</thead>
<tbody>
<x:forEach var="file" select="file[unsuccessful != 0]">
<util:replace var="name" oldChar="\\" newChar="/">
<x:expr select="$file/name"/>
</util:replace>
<tr>
<td><a href="${name.trim()}">${name.trim()}</a></td>
<td width="50" style="text-align:right" nowrap="nowrap"><b><x:expr select="$file/successful + $file/unsuccessful"/></b></td>
<td width="50" style="text-align:right"><b><span style="color:#00AA00;text-align:right"><x:expr select="$file/successful"/></span></b></td>
<td width="50" style="text-align:right"><b><span style="color:#FFA916;text-align:right"><x:expr select="count($file/result[status='warning'])"/></span></b></td>
<td width="50" style="text-align:right"><b><span style="color:#FF0000;text-align:right"><x:expr select="count($file/result[status='error'])"/></span></b></td>
</tr>
<tr>
<td colspan="5">
<x:forEach var="result" select="$file/result">
<j:set var="status"><x:expr select="$result/status"/></j:set>
<j:set var="target"><x:expr select="$result/target"/></j:set>
<j:set var="errorMessage"><x:expr select="$result/errorMessage"/></j:set>
<j:if test="${status != 'valid'}">
<img src="images/trans.gif" alt="trans" width="20" height="5" border="0"/><img src="images/icon_${status}_sml.gif" alt="${status}"/><img src="images/trans.gif" alt="trans" width="5" height="5" border="0"/> ${target} - <j:if test="${errorMessage != ''}"><span style="font-style:italic">${errorMessage}</span></j:if><br/>
</j:if>
</x:forEach>
</td>
</tr>
</x:forEach>
</tbody>
</table>
</j:if>
</section>
</body>
</document>
</jsl:template>
</jsl:stylesheet>