<?xml version="1.0" ?>
<!-- Preprocessor for the Schematron XML Schema Language.
   http://www.ascc.net/xml/resource/schematron/schematron.html
    Copyright (C) 1999 Rick Jelliffe and Academia Sinica Computing Centre
    Permission to use granted under GPL or MPL.
    
    Modified by Leigh Dodds 3rd Sept. 2000.
     1. Altered HTML to tidy up report
     2. Added call to modified version of xmlverbatim by Oliver Becker removing 
     need for a two-pass transformation: the original, syntax-highlighted XML 
     is included within the HTML report.
     3. Added additional CSS elements required for syntax hightlighting as defined 
     by xmlverbatim.

     This version of Schematron Report is derived from the original implementation 
     by David Carlisle, and requires xmlverbatim by Oliver Becker.
    
     Schematron Report: http://www.ascc.net/xml/resource/schematron/schematron-report.html
     xmlverbatim: http://www.informatik.hu-berlin.de/~obecker/XSLT/#xmlverbatim
     This version: http://www.ldodds.com/schematron/sch-report2.xsl
    
-->

<!-- Schematron report -->

<xsl:stylesheet
   version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias">

<xsl:import href="schematron-skeleton.xsl"/>

<xsl:template name="process-prolog">
   <axsl:output method="html" />
   
   
   <axsl:include href="http://home.freeuk.com/leigh.dodds/rss_validator/1.0/xmlverbatim.xsl"/>
      
   <!--
   <axsl:include href="xmlverbatim.xsl"/>
   -->
   
   
   
</xsl:template>

<xsl:template name="process-root">
   <xsl:param name="title" />
   <xsl:param name="contents" />
   <html>
      <style>
         .xmlverb-default          { color: #333333; background-color: #ffffff;
                                     font-family: monospace }
         .xmlverb-element-name     { color: #990000 }
         .xmlverb-element-nsprefix { color: #666600 }
         .xmlverb-attr-name        { color: #660000 }
         .xmlverb-attr-content     { color: #000099; font-weight: bold }
         .xmlverb-ns-name          { color: #666600 }
         .xmlverb-ns-uri           { color: #330099 }
         .xmlverb-text             { color: #000000; font-weight: bold }
         .xmlverb-comment          { color: #006600; font-style: italic }
         .xmlverb-pi-name          { color: #006600; font-style: italic }
         .xmlverb-pi-content       { color: #006666; font-style: italic }
      
      </style>
      <h2 title="Schematron contact-information is at the end of 
                 this page">
         <font color="#FF0080" >Schematron</font> Report
      </h2>
      <h1 title="{@ns} {@fpi}">
         <xsl:value-of select="$title" />
      </h1>
      
      <h3>Validation Report</h3>
      
      <div class="errors">
         <ul>
            <xsl:copy-of select="$contents" />
         </ul>
      </div>
      
      <p>
      <h3>Original RSS Source</h3>
      
      <axsl:apply-templates select="/" mode="xmlverb"/>
      
      </p>
      
      
      <hr color="#FF0080" />
      <p><font size="2">Schematron Report by David Carlisle. Modified by Leigh Dodds. 
      <a href="http://www.ascc.net/xml/resource/schematron/schematron.html"
         title="Link to the home page of the Schematron, 
                a tree-pattern schema language">
         <font color="#FF0080" >The Schematron</font>
      </a> by
      <a href="mailto:ricko@allette.com.au"
         title="Email to Rick Jelliffe (pronounced RIK JELIF)"
      >Rick Jelliffe</a>,
      <a href="http://www.sinica.edu.tw"
         title="Link to home page of Academia Sinica"
      >Academia Sinica Computing Centre</a>.
      </font></p>
   </html>
</xsl:template>

<xsl:template name="process-pattern">
   <xsl:param name="name" />
   <xsl:param name="see" />
   <xsl:choose>
      <xsl:when test="$see">
         <a href="{$see}" target="SRDOCO" 
            title="Link to User Documentation:">
            <h4 class="linked">
               <xsl:value-of select="$name" />
            </h4>
         </a>
      </xsl:when>
      <xsl:otherwise>
         <h4><xsl:value-of select="$name" /></h4>
      </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<!-- use default rule for process-name: output name -->

<xsl:template name="process-assert">
   <xsl:param name="pattern" />
   <xsl:param name="role" />
   <li>
      <a href="#{{generate-id(.)}}" title="Link to where this pattern was expected">
         <xsl:apply-templates mode="text"/>
         (<xsl:value-of select="$role"/>)
      </a>
   </li>                    
</xsl:template>

<xsl:template name="process-report">
   <xsl:param name="pattern" />
   <xsl:param name="role" />
   <li>
      <a href="#{{generate-id(.)}}" title="Link to where this pattern was found">
         <xsl:apply-templates mode="text"/>
         (<xsl:value-of select="$role"/>)
      </a>
   </li>
</xsl:template>


</xsl:stylesheet>
