<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet[
<!ENTITY nbsp "&#160;">
]>
<!--http://www.azizatech.com/rules/rulestransform.xsl -->
<!--This stylesheet transforms documents encoded in the rules DTD to an html version of the application guidelines.
Developed by Elizabeth Shaw
Aziza Technology Associates
Pittsburgh PA
http://www.azizatech.com
ejshaw@azizatech.com
Basic document structure is:
rules
  title
  desc?
	group+
		title
		element+
			children*
				child+
				appnotes
			options*
				attributes+
				appnotes?
			attributes*
				values
					value?
				appnotes
			tests*
				test+
				appnotes
			appnotes?
			
 rulestransforms.xsl Version 0.8 2004-12-10
 
Copyright (C) 2004 Aziza Technology Associates, LLC Pittsburgh, PA 
 http://www.azizatech.com
 This program is free software; you can redistribute it and/or modify 
 it under the terms of the Mozilla Public License available at 
http://www.mozilla.org/MPL/

 This program is distributed in the hope that it will be useful, 
 but WITHOUT ANY WARRANTY; without even the implied warranty of 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" indent="yes"/>
	<xsl:template match="/">
	<html>
		<head>
			<title><xsl:value-of select="rules/title"/></title>
		</head>
		<body>
		<h2><xsl:value-of select="rules/title"/></h2>
		<xsl:apply-templates select="rules/desc"/>
		<h4>Last Updated: <xsl:value-of select="rules/@date"/></h4>
		<xsl:apply-templates select="//group"/>
		</body>
	</html>
	</xsl:template>


<xsl:template match="group">
		<h2>
			<xsl:apply-templates select="title"/>
		</h2>
		<xsl:apply-templates select="desc"/>
		<table border="1" width="100%">
			<tbody>
				<tr>
					<th width="20%">Element Location</th>
					<th width="15%">Attributes or Child Elements</th>
					<th width="5%">Status</th>
					<th width="30%">Application Notes</th>
					<th width="15%">Possible Values</th>
					<th width="15%">Conditions</th>
				</tr>
				
					<xsl:for-each select="element">
					<tr><td>
						<xsl:choose>
						<xsl:when test="@context"><xsl:value-of select="@context"/>
</xsl:when><xsl:otherwise><xsl:value-of select="@path"/></xsl:otherwise>
					</xsl:choose>&nbsp;</td>
					<td>&nbsp;&nbsp;</td>
					<td><xsl:value-of select="@status"/>&nbsp;</td>
					<td><xsl:apply-templates select="appnotes"/>&nbsp;</td>
					<td>&nbsp;&nbsp;</td>
					<td><xsl:value-of select="@test"/>&nbsp;</td>
					
					</tr>
					<xsl:apply-templates select="tests"/>

					<xsl:apply-templates select="children"/>
					<xsl:apply-templates select="attribute"/>
					<xsl:apply-templates select="option"/>
					
					</xsl:for-each>
					
					</tbody>
					</table>
					
					</xsl:template>
					<xsl:template match="attribute">

					<tr><td>
						<!--<xsl:choose>
						<xsl:when test="ancestor::element/@context"><xsl:value-of select="ancestor::element/@context"/>
</xsl:when><xsl:otherwise><xsl:value-of select="ancestor::element/@path"/></xsl:otherwise>
					</xsl:choose>-->&nbsp;</td>
					<td>&nbsp;&nbsp;<xsl:value-of select="@name"/> =&nbsp;</td>
					<td><xsl:value-of select="@status"/>&nbsp;</td>
					<td><xsl:apply-templates select="appnotes"/>&nbsp;</td>
                         <td><xsl:choose><xsl:when test="values/@type='single'">Set to '<xsl:value-of select="values/value"/>'</xsl:when>
<xsl:when test="values/@type='pattern' and values/@standard">Use <xsl:value-of select="values/@standard"/></xsl:when>
<xsl:when test="values/@type='cdata'">cdata</xsl:when>
<xsl:when test="values/@type='multi'">Possible values: <br/> <xsl:for-each select="values/value"><xsl:if test="@crosswalk"><xsl:value-of select="@crosswalk"/>: </xsl:if><xsl:value-of select="."/><br/></xsl:for-each>&nbsp;
					</xsl:when>																									</xsl:choose>
                        </td> <td><xsl:value-of select="@test"/>
                        &nbsp;</td>


					</tr>
					</xsl:template>
<xsl:template match="option">
<tr><td><xsl:choose>
						<xsl:when test="ancestor::element/@context"><xsl:value-of select="ancestor::element/@context"/>
</xsl:when><xsl:otherwise><xsl:value-of select="ancestor::element/@path"/></xsl:otherwise>
					</xsl:choose>&nbsp;</td>
<td>Include one of: <xsl:for-each select="attribute"><br/> &nbsp;<xsl:value-of select="@name"/>=</xsl:for-each> </td>
<td><xsl:value-of select="@status"/>&nbsp;</td>
<td><xsl:apply-templates select="appnotes"/>&nbsp;</td>
					<td>Attributes ; <xsl:for-each select="attribute"><br/><xsl:value-of select="@name"/></xsl:for-each>&nbsp;</td>
					<td>&nbsp;</td>
					
					</tr>
 
</xsl:template>
<xsl:template match="children">
<tr><td>
						<xsl:choose>
						<xsl:when test="ancestor::element/@context"><xsl:value-of select="ancestor::element/@context"/>
</xsl:when><xsl:otherwise><xsl:value-of select="ancestor::element/@path"/></xsl:otherwise>
					</xsl:choose>&nbsp;</td>
					<td>Child Elements: <br/><xsl:for-each select="child">&lt;<xsl:value-of select="."/>&gt; <xsl:if test="position() != last()"><xsl:choose>
	<xsl:when test="ancestor::children/@include='oneof'"> or </xsl:when>
	<xsl:when test="ancestor::children/@include='all' or ancestor::children/@include='include'">,  </xsl:when>
</xsl:choose> </xsl:if></xsl:for-each>&nbsp;</td>
					<td><xsl:value-of select="@status"/>&nbsp;</td>
					<td><xsl:apply-templates select="appnotes"/>&nbsp;</td>
					<td><xsl:for-each select="child">&lt;<xsl:value-of select="."/>&gt; <xsl:if test="position() != last()"><xsl:choose>
	<xsl:when test="ancestor::children/@include='oneof'"> or </xsl:when>
	<xsl:when test="ancestor::children/@include='all' or ancestor::children/@include='include'">,  </xsl:when>
</xsl:choose> </xsl:if></xsl:for-each>&nbsp;</td>
					<td>&nbsp;&nbsp;</td>
					

	</tr>

</xsl:template>
<xsl:template match="tests">
<tr><td>
						<xsl:choose>
						<xsl:when test="ancestor::element/@context"><xsl:value-of select="ancestor::element/@context"/>
</xsl:when><xsl:otherwise><xsl:value-of select="ancestor::element/@path"/></xsl:otherwise>
					</xsl:choose>&nbsp;</td>
					<td>Tests: <br/><xsl:for-each select="test"><xsl:value-of select="."/> <xsl:if test="position() != last()"><xsl:choose>
	<xsl:when test="ancestor::tests/@include='oneof'"> or </xsl:when>
	<xsl:when test="ancestor::tests/@include='all' or ancestor::tests/@include='include'">, </xsl:when>
</xsl:choose> </xsl:if></xsl:for-each>&nbsp;</td>
					<td><xsl:value-of select="@status"/>&nbsp;</td>
					<td><xsl:apply-templates select="appnotes"/>&nbsp;</td>
					<td><xsl:for-each select="test"><xsl:value-of select="."/> <xsl:if test="position() != last()"><xsl:choose>
	<xsl:when test="ancestor::tests/@include='oneof'"> or </xsl:when>
	<xsl:when test="ancestor::tests/@include='all' or ancestor::children/@include='include'">, </xsl:when>
</xsl:choose> </xsl:if></xsl:for-each>&nbsp;</td>
					<td>&nbsp;&nbsp;</td>
					

	</tr>

</xsl:template>
<xsl:template match="desc|titlle|p|appnotes">
<xsl:copy-of select="."/></xsl:template>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->