<?xml version="1.0" ?>
<!-- Pretty Printer for the Schematron XML Schema Language.
	http://www.ascc.net/xml/resource/schematron/schematron.html

 Copyright (c) 1999,2000 Rick Jelliffe and Academia Sinica Computing Center, Taiwan

 This software is provided 'as-is', without any express or implied warranty. 
 In no event will the authors be held liable for any damages arising from 
 the use of this software.

 Permission is granted to anyone to use this software for any purpose, 
 including commercial applications, and to alter it and redistribute it freely,
 subject to the following restrictions:

 1. The origin of this software must not be misrepresented; you must not claim
 that you wrote the original software. If you use this software in a product, 
 an acknowledgment in the product documentation would be appreciated but is 
 not required.

 2. Altered source versions must be plainly marked as such, and must not be 
 misrepresented as being the original software.

 3. This notice may not be removed or altered from any source distribution.
    1999-11-2 Created Rick Jelliffe
	CSS ideas borrowed from Dr Nic's Schematron tutorial format.
    1999-11-5 Beta for DTD 1.2
    1999-11-5 Amended for IE5 by Adrian Edwards
	
-->
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/TR/WD-xsl"
  xmlns="http://www.w3.org/Profiles/xhtml1-strict" >

<!-- Simulate built-in templates for IE5 -->
<xsl:template match="*|@*"><xsl:apply-templates /></xsl:template>
<xsl:template match="text()"><xsl:value-of select="." /></xsl:template>

<!-- Category: document root -->

<xsl:template match="/"><xsl:apply-templates /></xsl:template>

<!-- Category: top-level-element -->

<xsl:template match="schema">
<html><head><title><xsl:value-of select="title" /></title></head>
<style type="text/css">
a:onmouseover { color:#FF0080; }
a:visited { color:#003399; }
td.titlebar1
{
    BACKGROUND-COLOR: #404040;
    COLOR: #1043B9;
    FONT-SIZE: 0.8em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: right;
}
td.titlebar2
{
    BACKGROUND-COLOR: #1043C9;
    COLOR: #003399;
    FONT-SIZE: 0.8em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: right;
}
td.titlebar3
{
    BACKGROUND-COLOR: #1043C9;
    COLOR: #003399;
    FONT-SIZE: 0.8em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: right;
}
th.titlebar1
{
    BACKGROUND-COLOR: #404040;
    COLOR: #003399;
    FONT-SIZE: 0.9em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: left;
}
th.titlebar2
{
    BACKGROUND-COLOR: #1043C9;
    COLOR: #003399;
    FONT-SIZE: 0.9em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: left;
}
th.titlebar3
{
    BACKGROUND-COLOR: #1043C9;
    COLOR: #003399;
    FONT-SIZE: 0.9em;
    FONT-WEIGHT: bold;
    TEXT-ALIGN: left;
}
span.titlebar
{
    BACKGROUND-COLOR: white;
    COLOR:#003399;
}
</style>
<body> 
<h2 title="Schematron contact-information is at the end of this page">
<font color="#FF0080">Schematron</font> Pretty</h2>
	<xsl:apply-templates />
<hr color="#FF0080" />
<p>
<font size="2">Schematron Pretty by Rick Jelliffe, Adrian Edwards.  
<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@gate.sinica.edu.tw" 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>
</body>
</html>
</xsl:template>

<xsl:template match="title">
	<h1><xsl:apply-templates /></h1>
	<xsl:if test="../@ns"><h3><xsl:value-of select="../@ns" /></h3></xsl:if>
	<xsl:if test="../@fpi"><h3><i><xsl:value-of select="../@fpi" /></i></h3></xsl:if>
</xsl:template>

<xsl:template match="pattern">
<table width='100%' border='0' cellspacing='0'>
<tr><th class='titlebar1'>&#x00A0;&#x00A0;&#x00A0;<span class='titlebar'>&#x00A0;&#x00A0;Pattern&#x00A0;&#x00A0;</span></th> <td class='titlebar1'>
<span class='titlebar' title="id" ><span style="color:red"><xsl:value-of select="@id" /></span
><i><xsl:value-of select="@fpi" /></i></span>
</td></tr>
</table>
	<h2 title="name"><xsl:value-of select="@name" /></h2>
	<xsl:if test="@see">
		<p>For documentation, please refer to <a href="@see"><xsl:value-of select="@see" /></a></p>
	</xsl:if>
<div align="right">
<table rules="none" frame="below"  border="1" cellspacing='0' width="95%">
	<xsl:apply-templates />
</table>
</div>
<br />
<br />
<br />
</xsl:template>

<xsl:template match="rule">
<tr><th class='titlebar2' colspan="3">&#x00A0;&#x00A0;&#x00A0;<span class='titlebar'>&#x00A0;&#x00A0;Rule 
<span style="color:red"><xsl:value-of select="@role" /></span>
&#x00A0;&#x00A0;</span></th></tr>
	<tr><td title="rule context" style="width:20%" ><tt><xsl:value-of select="@context"/></tt>
	</td></tr>
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="assert">
<tr>
<th />
<th class='titlebar3' colspan="2">&#x00A0;&#x00A0;&#x00A0;<span class='titlebar'>&#x00A0;&#x00A0;Assert 
<span title="assert role" style="color:red"><xsl:value-of select="@role" /></span>
&#x00A0;&#x00A0;</span></th>
</tr>
<tr>
<td />
<td title="assert test"><tt><xsl:value-of select="@test" /></tt>
	</td><td title="assert"><xsl:apply-templates /></td>
	</tr>
</xsl:template>

<xsl:template match="key">
<tr>
<th />
<th class='titlebar3' colspan="2">&#x00A0;&#x00A0;&#x00A0;<span class='titlebar'>&#x00A0;&#x00A0;Key 
<span title="key name" style="color:red"><xsl:value-of select="@name" /></span>
&#x00A0;&#x00A0;</span></th>
</tr>
<tr>
<td />
<td title="key path"><tt><xsl:value-of select="@path" /></tt>
	</td><td><xsl:apply-templates /></td>
	</tr>
</xsl:template>

<xsl:template match="report">
<tr>
<th />
<th class='titlebar3' colspan="2">&#x00A0;&#x00A0;&#x00A0;<span class='titlebar'>&#x00A0;&#x00A0;Report 
<span title="report role" style="color:red"><xsl:value-of select="@role" /></span>
&#x00A0;&#x00A0;</span></th>
</tr>
<tr>
<td />
<td title="report test"><tt><xsl:value-of select="@test" /></tt>
	</td><td title="report" style="width:50%"><xsl:apply-templates /></td>
<td >
	</td>
	</tr>
</xsl:template>

<xsl:template match="name">
	<tt title="name">&lt;name path="<b><xsl:value-of select="@path" /></b>"/&gt;</tt>
</xsl:template>

</xsl:stylesheet>
