<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="search">dictionary.jsp?style=xml&amp;term=</xsl:variable>

<xsl:template match="spaseDD">
	<xsl:for-each select="entry">
		<table>
		<tr>
			<td width="50%" bgcolor="#000000" align="left"><font color="#FFFFF"><xsl:value-of select="term"/></font></td>
			<td width="50%" bgcolor="#FFFFFF" align="right"><xsl:value-of select="type"/></td>
		</tr>
		<tr><td colspan="2"><xsl:value-of select="definition"/></td></tr>
		</table>
		<xsl:apply-templates select="elements" /> 
		<xsl:apply-templates select="values" /> 
		<xsl:apply-templates select="usage" /> 
	</xsl:for-each>
</xsl:template>

<xsl:template match="elements">
	<table><tr><td width="40"></td><td valign="top">Sub-elements:</td><td>
	<xsl:for-each select="element">
		<xsl:variable name="hrefval" select="." />
		<a href="{$search}{$hrefval}"><xsl:value-of select="."/></a><br />
	</xsl:for-each>
	</td></tr></table>
</xsl:template>

<xsl:template match="usage">
	<table><tr><td width="40"></td><td valign="top">Used by:</td><td>
	<xsl:for-each select="usedby">
		<xsl:variable name="hrefval" select="." />
		<a href="{$search}{$hrefval}"><xsl:value-of select="."/></a><br />
	</xsl:for-each>
	</td></tr></table>
</xsl:template>

<xsl:template match="values">
	<table><tr><td width="40"></td><td valign="top">Allowed values:</td><td>
	<xsl:for-each select="value">
		<xsl:variable name="hrefval" select="." />
		<a href="{$search}{$hrefval}"><xsl:value-of select="."/></a><br />
	</xsl:for-each>
	</td></tr></table>
</xsl:template>

</xsl:stylesheet>
