<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />

<xsl:template match="Properties">
<table border="1">
<tr>
<td>npu code</td>
<td>short form</td>
<td>system</td>
<td>component</td>
<td>kind-of-property</td>
<td>unit</td>
</tr>
</table>
<xsl:apply-templates />
</xsl:template>

<xsl:template match="Property">
<table>
	<tr>
	<td>
	<xsl:value-of select="NPUCode" />
	</td>
	<td>
	<xsl:value-of select="ShortForm" disable-output-escaping="yes" />
	</td>
	<td>
	<xsl:choose>
		<xsl:when test="System/Element/Abbreviation">
			<xsl:value-of select="System/Element/Abbreviation" disable-output-escaping="yes" />
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="System/Element/Display" disable-output-escaping="yes" />
		</xsl:otherwise>
	</xsl:choose><xsl:if test="System/SystemSpecification">
		(<xsl:for-each select="System/SystemSpecification">
			<xsl:if test="not(position() = 1)">
				<xsl:text>; </xsl:text>
			</xsl:if>
			<xsl:choose>
				<xsl:when test="Element/Abbreviation">
					<xsl:value-of select="Element/Abbreviation" disable-output-escaping="yes" />
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="Element/Display" disable-output-escaping="yes" />
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>)
	</xsl:if>
	</td>
	<td>

	<xsl:for-each select="Component|Aggregator">
		<xsl:choose>
			<xsl:when test="Element/Display">
				<xsl:value-of select="Element/Display" disable-output-escaping="yes" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="Element/Name" disable-output-escaping="yes" />
			</xsl:otherwise>
		</xsl:choose><xsl:if test="ComponentSpecification">
			(<xsl:for-each select="ComponentSpecification|Aggregator">
				<xsl:choose>
					<xsl:when test="self::ComponentSpecification">
						<xsl:if test="not(ancestor::Component/Aggregator)">
							<xsl:if test="not(position() = 1)">
								<xsl:text>; </xsl:text>
							</xsl:if>
						</xsl:if>
						<xsl:choose>
							<xsl:when test="Element/Abbreviation">
								<xsl:value-of select="Element/Abbreviation" disable-output-escaping="yes" />
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="Element/Display" disable-output-escaping="yes" />
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="Name" disable-output-escaping="yes" />
					</xsl:otherwise>
				</xsl:choose>
				
			</xsl:for-each>)
		</xsl:if>
	</xsl:for-each>
	</td>
	<td>	
	<xsl:choose>
		<xsl:when test="KindOfProperty/Element/Abbreviation">
			<xsl:value-of select="KindOfProperty/Element/Abbreviation" disable-output-escaping="yes" />
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="KindOfProperty/Element/Display" disable-output-escaping="yes" />
		</xsl:otherwise>
	</xsl:choose><xsl:if test="KindOfProperty/KindOfPropertySpecification">
		(<xsl:for-each select="KindOfProperty/KindOfPropertySpecification">
			<xsl:if test="not(position() = 1)">
				<xsl:text>; </xsl:text>
			</xsl:if>
			<xsl:choose>
				<xsl:when test="Element/Abbreviation">
					<xsl:value-of select="Element/Abbreviation" disable-output-escaping="yes" />
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="Element/Display" disable-output-escaping="yes" />
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>)
	</xsl:if>
	</td>
	<td>
	<xsl:if test="Unit">
		<xsl:choose>
			<xsl:when test="Unit/Element/Abbreviation">
				<xsl:value-of select="Unit/Element/Abbreviation" disable-output-escaping="yes" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="Unit/Element/Display" disable-output-escaping="yes" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:if>
	</td>
	</tr>
</table>
</xsl:template>

</xsl:stylesheet>


