<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
                exclude-result-prefixes="doc"
                version='1.0'>

<xsl:output method="html"
            encoding="ISO-8859-1"
            indent="no"/>

    
<xsl:template match="Studienplan">
	<html>
	<head>
		<title>Studienplan</title>
	</head>
	<body>
		<div align="center"><h1>Studienplan</h1></div>
		<xsl:apply-templates />
	
	</body>
	</html>
</xsl:template>

<xsl:template match="logo">
<div align="center">
	<p>
	 <img src="{.}"></img>
	</p>
</div>
</xsl:template>


<xsl:template match="/">
		<xsl:apply-templates/>
</xsl:template>

<xsl:template match="Studiengang">  
	<div align="center">
		<h2>
			<xsl:text>Studiengang:</xsl:text>
			<xsl:value-of select="."/>
		</h2>
	</div>
</xsl:template>

<xsl:template match="Semester">
	<div align="center">
		<h2>
			<xsl:text>Semester:</xsl:text>
			<xsl:value-of select="."/>
			<xsl:text>Halbjahr:</xsl:text>
			<xsl:if test="./@Halbjahr='S'">
				<xsl:text>Sommer</xsl:text>
			</xsl:if>
			<xsl:if test="./@Halbjahr='W'">
				<xsl:text>Winter</xsl:text>
			</xsl:if>
		</h2>
	</div>
</xsl:template>

<xsl:template match="Tag">
   	<div align="left"><h4>
  	<xsl:text>Wochentag:&#160;</xsl:text>
 	<xsl:value-of select="./@Name"/>
	</h4>
	 	<table border="1" width="800">
  		<tr>
		<th>Nummer</th>
     		<th>Zeit</th>
     		<th>Raum</th>
      	<th>Titel</th>
     		<th>Dozent</th>
     		<th>Voraussetzung</th>
     		<th>Beschreibung</th>
      	<th>EDVNr.</th>
    		</tr>
 	     		<xsl:apply-templates select="Eintrag" />
 	 	</table>
   	</div>
</xsl:template>


<xsl:template match="Eintrag">
	<tr>
	<td><xsl:number/></td> 	
	<xsl:apply-templates select="Zeit" />
	<xsl:apply-templates select="Raum" />
	<xsl:apply-templates select="Titel" />
	<xsl:apply-templates select="Dozent" />
	<xsl:apply-templates select="Voraussetzung" />
	<xsl:apply-templates select="Beschreibung" />
	<td><xsl:value-of select="./@EDVNummer"/></td>
 	</tr>
</xsl:template>

<xsl:template match="Zeit">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Raum">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Titel">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Dozent">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Voraussetzung">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Beschreibung">
	<td>
  	<xsl:value-of select="."/>
	</td>
</xsl:template>

<xsl:template match="Summe">
	<hr />
	<div align="center">
      <br />
	<h2>Summe: &#160;	  <xsl:value-of select="."/></h2>
	</div>
</xsl:template>

</xsl:stylesheet>
