XSL:
<xsl:template match="/">
<html>
<head>
<title>RPT Report</title>
<link rel="stylesheet" type="text/css" href="resource/rpt.css" media="screen"/>
<script src="resource/sorttable.js"/>
</head>
<body>
<div style="margin: 10px;">
<table class="rpt">
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Total</th>
<th>Overview</th>
</tr>
</thead>
<tbody>
<td><img src="resource/fatal.gif" alt="Violations in build"
title="Violations in build"/></td>
<td class="left" nowrap="nowrap">Violations</td>
<td><xsl:value-of select="sum(report/resultset/@violation)"/></td>
<td rowspan="5">
<img><xsl:attribute name="src">
<xsl:value-of
select="concat('http://chart.apis.google.com/chart?cht=p3&chd=t:', report/percentages/@violation, ',', report/percentages/@potential, ',', report/percentages/@recommendation, ',', report/percentages/@pRecommendation, ',', report/percentages/@manualcheck, '&chs=450x100&chl=Violation|Potential Violation|Recommendation|Potential Recommendation|Manual Check&chco=000000,ff0000,6277b5,46b0a5,ffff00')"
/>
</xsl:attribute></img>
</td>
<tr>
<td><img src="resource/error.gif" alt="Potential Violation in build"
title="Potential Violation in build"/></td>
<td class="left">Potential Violation</td>
<td><xsl:value-of select="sum(report/resultset/@potential)"/></td>
</tr>
<tr>
<td>
<img src="resource/published.gif" alt="Recommendations in build"
title="Recommendations in build"/>
</td>
<td class="left">Recommendation</td>
<td>
<xsl:value-of select="sum(report/resultset/@recommendation)"/>
</td>
</tr>
<tr>
<td>
<img src="resource/draft.gif" alt="Potential Recommendations in build"
title="Potential Recommendations in build"/>
</td>
<td class="left">Potential Recommendation</td>
<td>
<xsl:value-of select="sum(report/resultset/pRecommendation)"/>
</td>
</tr>
<tr>
<td>
<img src="resource/warning.gif" alt="Manual Checks in build"
title="Warnings in build"/>
</td>
<td class="left">Manual Check</td>
<td>
<xsl:value-of select="sum(report/resultset/@manualcheck)"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<xsl:apply-templates select="report"/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="report">
<table class="rpt sortable">
<thead>
<tr>
<th class="center">Filename</th>
<th class="center">Level</th>
<th class="center">GID</th>
<th class="center">Message</th>
<th class="center">XPath</th>
<th class="center">Line Number</th>
<th class="center">Help</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="issue">
<xsl:sort select="@filename" order="descending" data-type="text"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:template>
<xsl:template match="issue">
<tr class="alt_0">
<td class="center"><a href="{@infocenterURL}"><xsl:value-of select="@filename"
/></a></td>
<td class="center"><xsl:value-of select="@level"/></td>
<td class="center"><xsl:value-of select="@gid"/></td>
<td class="center"><xsl:value-of select="@message"/></td>
<td class="center"><xsl:value-of select="@xpath"/></td>
<td class="center"><xsl:value-of select="@linenum"/></td>
<td class="center"><a href="{@helplink}">More</a></td>
</tr>
</xsl:template>
The issue am having is that I can't seem to make it display both the result set
template and the report
template, further more its not applying the CSS. I did have a working copy that just needed muenchian grouping implementing but I took 1 step forward and 5 steps back attempting this :P
EDIT: Okay so the CSS is now working. Although its not retrieving the correct values from the xml.
EDIT: fixed those issues
XML:
<report created="2013-12-02 13:38:42.15" pluginname="sal">
<percentages manualcheck="0" pRecommendation="0" potential="69" recommendation="0" violation="30"/>
<resultset created="2013-12-02 13:38:42.15" link="writers_reports/" manualcheck="0" name="" pRecommendation="0" potential="229" recommendation="0" violation="100"/>
<issue filename="rpt_automation.html" gid="506" helplink="" infocenterURL="" level="Potential Violation" linenum="63" message="Ensure that, with the border or outline, the keyboard focus indicator is visible to users." xpath="/html/body/div[3]/img"/>
<issue filename="rpt_summary.html" gid="506" helplink="" infocenterURL="" level="Potential Violation" linenum="61" message="Ensure that, with the border or outline, the keyboard focus indicator is visible to users." xpath="/html/body/div[3]/img"/>
<issue filename="scan_results.html" gid="506" helplink="" infocenterURL="" level="Potential Violation" linenum="50" message="Ensure that, with the border or outline, the keyboard focus indicator is visible to users." xpath="/html/body/div[3]/img"/>
<issue filename="what_is_rpt.html" gid="506" helplink="" infocenterURL="" level="Potential Violation" linenum="49" message="Ensure that, with the border or outline, the keyboard focus indicator is visible to users." xpath="/html/body/div[3]/img"/>