<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xh="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<xsl:output method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
	<!-- This XSD Documentor XSLT assumes that Excelon Stylus Studio has been used
	to produce the initial version of the HTML documentation for the XML Schema.  
	This XSLT will reset the title, change the address for the jpg images, and 
	create links to the other XSD documentation files. -->

	<xsl:param name="Title" select="''"/>

	<xsl:template match="/">
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<title>
					<xsl:choose>
						<xsl:when test="string-length($Title) > 0"><xsl:value-of select="$Title"/></xsl:when>
						<xsl:otherwise><xsl:value-of select="h:html/h:head/h:title"/></xsl:otherwise>
					</xsl:choose>
				</title>
				<meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1"/>
				<xsl:copy-of select="h:html/h:head/h:style"/>
				<xsl:copy-of select="h:html/h:head/h:script"/>
			</head>
			<body onload="init();">
				<h1>
					<a name="top">
						<xsl:choose>
							<xsl:when test="string-length($Title) > 0"><xsl:value-of select="$Title"/></xsl:when>
							<xsl:otherwise><xsl:value-of select="h:html/h:head/h:title"/></xsl:otherwise>
						</xsl:choose>
					</a>
				</h1>
				<xsl:apply-templates select="h:html/h:body/*[name() != 'h1']" mode="documentation"/>
			</body>
		</html>
	</xsl:template>

	<xsl:template match="*|text()" mode="documentation">
		<xsl:choose>
			<xsl:when test="name() = '' or name() = '#text'">
				<xsl:choose>
					<xsl:when test="contains(., '.xsd') and string-length(substring-after(., '.xsd')) = 0">
						<a>
							<xsl:attribute name="href"><xsl:value-of select="concat(substring-before(., '.xsd'), '.html')"/></xsl:attribute>
							<xsl:value-of select="."/>
						</a>
					</xsl:when>
					<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:element name="{name()}">
					<xsl:for-each select="./@*[string-length(.) > 0]">
						<xsl:attribute name="{name()}">
							<xsl:choose>
								<xsl:when test="contains(., $Title)"><xsl:value-of select="concat('wc', substring-after(., $Title))"/></xsl:when>
								<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
							</xsl:choose>
						</xsl:attribute>
					</xsl:for-each>

					<xsl:apply-templates select="*|text()" mode="documentation"/>
				</xsl:element>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
<metaInformation>
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->