<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"
version="1.0">

  <xsl:output method="xml" 
    media-type="text/html" 
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="DTD/xhtml1-strict.dtd"
	
    cdata-section-elements="script"
	omit-xml-declaration="yes"
    indent="yes"
    encoding="ISO-8859-1"/>
	
<xsl:template match="root">
<html>
<head>
	<title>Campus Arenberg</title>
</head>
<body>

	<h1>Modeled entities</h1>
	<ol>
		<xsl:apply-templates>
			<xsl:sort select="@name"/>
		</xsl:apply-templates>
	</ol>
	<p>
		<map id="model">
			<xsl:apply-templates select="//area" mode="map"/>
		</map>
		<img src="../map.png" usemap="#model" alt="a 2D projection of the 3D campus model"/>
	</p>
</body>
</html>

</xsl:template>

<xsl:template match="Group">
	<li class="{@type}">
		<xsl:value-of select="@name"/>
		<xsl:if test="Group">
			<ol>
				<xsl:apply-templates select="Group">
					<xsl:sort select="@name"/>
				</xsl:apply-templates>
			</ol>
		</xsl:if>
	</li>
</xsl:template>

<xsl:template match="area" mode="map">
<area href="{parent::Group/@url}" shape="poly" title="{parent::Group/@name}" alt="{parent::Group/@name}">
	<xsl:attribute name="coords">
		<xsl:apply-templates/>
	</xsl:attribute>
</area>
</xsl:template>

<xsl:template match="point">
	<xsl:if test="position()!=1">,</xsl:if>
	<xsl:value-of select="@x"/>,<xsl:value-of select="@y"/>
</xsl:template>

</xsl:stylesheet>
