<xsl:stylesheet 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 	version="1.0">   

<xsl:template match="/">
	<HTML>
		<BODY>
			<FONT FACE="Arial Narrow">
				<xsl:apply-templates/>
			</FONT>
		</BODY>
	</HTML>
</xsl:template>

<xsl:template match="component">
	<xsl:apply-templates select="preface"/>
	<xsl:apply-templates select="help"/>
	<br/>
	<FONT SIZE="6">
	<xsl:text>void </xsl:text><xsl:value-of select="componentID"/><xsl:text> (</xsl:text><br/>
	<xsl:apply-templates select="interface"/>
	<xsl:text>)</xsl:text>
	<p/>
	</FONT>
</xsl:template>

<xsl:template match="preface">
	<FONT COLOR="red" SIZE="8">
	<B>
		<xsl:value-of select="title"/>
	</B>
	</FONT>
	<HR/>
	<FONT COLOR="black" SIZE="6">
		<xsl:apply-templates select="author"/>
	</FONT>
</xsl:template>

<xsl:template match="author">
	Author:<xsl:text> </xsl:text>
	<xsl:element name="a">
		<xsl:attribute name="href">
			<xsl:text>mailto:</xsl:text><xsl:value-of select="email"/>
		</xsl:attribute>
		<xsl:value-of select="name"/>
	</xsl:element>
	<br/>
</xsl:template>

<xsl:template match="help">
	<FONT COLOR="black" SIZE="6">
	<xsl:text>Click </xsl:text>
	<xsl:element name="a">
		<xsl:attribute name="href">
			<xsl:value-of select="."/>
		</xsl:attribute>
		here
	</xsl:element>
	<xsl:text> for help.</xsl:text>
	</FONT>
	<br/>
</xsl:template>

<xsl:template match="interface">
	<xsl:for-each select="input|output">
		<xsl:sort select="@position" data-type="number"/>
			<DD>
			<xsl:value-of select="@type"/><xsl:text> </xsl:text>
			<xsl:if test="name()='input'">
				<FONT SIZE="6" COLOR="red">
					<xsl:value-of select="@tag"/>
				</FONT>
			</xsl:if>
			<xsl:if test="name()='output'">
				<FONT FACE="Times New Roman" SIZE="6" COLOR="green">
					<xsl:value-of select="@tag"/>
				</FONT>
			</xsl:if>
			<xsl:if test="position()!=last()"><xsl:text>,</xsl:text></xsl:if>
			</DD>
			<br/>
	</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

