<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:sp="http://valet.webthing.com/xmlns/sp"
	xmlns:valet="http://valet.webthing.com/xmlns/valet"
>
<xsl:output method="html" />
<xsl:template match="/valet:valsrc">
<html lang="en">
<head>
<title>Site Valet: Page Report</title>
<base href="http://valet.webthing.com/page/" />
<link type="text/css" rel="stylesheet" href="/base.css" />
<link type="text/css" rel="stylesheet" href="/valsrc.css" />
<link rev="made" href="http://valet.webthing.com/" />
<meta name="Generator" content="Site Valet"/>
<script type="text/javascript" src="jim.js">
</script>
</head>
<body>
<div id="header">
<div style="float:left">
<a href="/">Site&#160;Valet</a> <br/>
<a href="/qa/">Quality&#160;Assurance</a> <br/>
<a href="/tools.html">Developer&#160;Tools</a> <br/>
<a href="mailto:nick@webthing.com">Contact</a>
</div>
<h1 class="qa" style="float:right">
<a href="/qa-report/referer">
<img width="100" height="100"
class="right" src="/qa/qa1.gif" alt="QA Check" /></a>
Page Valet Report
</h1>
<br style="clear: both"/>
</div>
<div>
<br style="clear: both"/>
<div id="reports">
<h3>Further Reports</h3>
<ul>
<li>
<a onclick="wysiwyg(document); return false;" href="#">WYSIWYG view</a>
</li>
<li>
<xsl:element name="a">
<xsl:attribute name="href"
>../link/link.cgi/<xsl:value-of select="valet:docinfo/@url"/></xsl:attribute
>Links Report
</xsl:element>
</li><li>
<xsl:element name="a">
<xsl:attribute name="href"
>../cg-eye/fetch.cgi/<xsl:value-of select="valet:docinfo/@url"/></xsl:attribute
>Forms/Scripts
</xsl:element>
</li>
</ul>
</div>
<xsl:apply-templates select="valet:docinfo"/>
<xsl:if test="count(valet:msg)>0">
<div>
<h3 style="clear: both">Processing Messages</h3>
</div>
<ol>
<xsl:apply-templates select="valet:msg"/>
</ol>
</xsl:if>
<xsl:apply-templates select="sp:report"/>
</div>
<div class="footer">
<div style="float:left">
<a href="/">Site Valet</a>
<xsl:text disable-output-escaping="no">
-&gt;
</xsl:text>
<a href="./">Page Valet</a>
<xsl:text disable-output-escaping="no">
-&gt; Report
</xsl:text>
<br/>
<a href="http://validator.w3.org/check/referer">
<img src="http://www.w3.org/Icons/valid-html401" class="w3"
alt="Valid HTML!" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator">
<img src="http://jigsaw.w3.org/css-validator/images/vcss" class="w3"
alt="Valid CSS!" height="31" width="88" /></a>
</div>
<a href="/home.apl" style="float: right"><img src="/logo.apl" alt="Home" /></a>
</div>
</body>
</html>
</xsl:template>

<xsl:template match="valet:msg">
<xsl:element name="li">
<strong><xsl:value-of select="@severity"/>:</strong>
<xsl:value-of select="text()"/>
</xsl:element>
</xsl:template>

<xsl:template match="sp:report">
<div id="normsrc">
<h2>Annotated Source</h2>
<p>This shows your source, normalised by our validating parser.
Any errors in your source are annotated, and will be highlighted
(provided your browser supports CSS).</p>
<xsl:apply-templates select="sp:element"/>
</div>
</xsl:template>

<xsl:template match="sp:element">
<xsl:choose>
<xsl:when test="@empty = 1">
<xsl:element name="div">
<xsl:attribute name="class">emptyel</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
&lt;<strong><xsl:value-of select="@name"/></strong>
<xsl:apply-templates select="sp:attribute"/>
<xsl:value-of select="//valet:valsrc/valet:empty"/>
<xsl:apply-templates select="sp:message"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="class">element</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
&lt;<strong><xsl:value-of select="@name"/> </strong>
<xsl:apply-templates select="sp:attribute"/>&gt;
<xsl:apply-templates select="sp:limit"/>
<xsl:apply-templates select="sp:message"/>
<xsl:apply-templates select="(text()|sp:element)"/>
<br/>&lt;/<strong><xsl:value-of select="@name"/></strong>&gt;
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="sp:limit">
<p class="limit"><strong>System Limit: </strong>
<xsl:value-of select="text()"/>
</p>
</xsl:template>

<xsl:template match="sp:attribute">
<xsl:text> </xsl:text>
<xsl:element name="em">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="class">attribute</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>=<xsl:element name="em"
><xsl:attribute name="class">attval</xsl:attribute
>"<xsl:value-of select="text()"/>"</xsl:element>
</xsl:template>

<xsl:template match="sp:text">
<xsl:value-of select="text()"/>
</xsl:template>


<xsl:template match="sp:message">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:value-of select="@sp:severity"/>
</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<strong><xsl:value-of select="@sp:severity"/></strong>
At <xsl:value-of select="@sp:location"/>
line <xsl:value-of select="@sp:line"/>,
column <xsl:value-of select="@sp:column"/>
<br/><em class="message"><xsl:value-of select="text()"/></em>
<xsl:apply-templates select="sp:reference"/>
</xsl:element>
</xsl:template>

<xsl:template match="sp:reference">
<br/>
<span class="reference">
At line <xsl:value-of select="@sp:line"
/>, column <xsl:value-of select="@sp:column"/>:
<xsl:value-of select="text()"/>
</span>
</xsl:template>

<xsl:template match="valet:docinfo">
<div id="docinfo">
<h2>Document Details</h2>
<table summary="Document Details">
<tbody>
<tr><th>URL</th><td><xsl:element name="a"
><xsl:attribute name="href"><xsl:value-of select="@url"
/></xsl:attribute
><xsl:value-of select="@url"/></xsl:element></td></tr>
<tr><th>MIME Type</th><td><xsl:value-of select="@mimetype"/></td></tr>
<tr><th>Document Type</th><td><xsl:value-of select="@doctype"/></td></tr>
<tr><th>Character Set</th><td><xsl:value-of select="@charset"/></td></tr>
<tr><th>Last Modified</th><td><xsl:value-of select="@lastmod"/></td></tr>
<tr><th>Length</th><td><xsl:value-of select="@clength"/></td></tr>
</tbody>
</table>
</div>
</xsl:template>
</xsl:stylesheet>

