<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output doctype-public="-//W3C//DTD HTML 4.01//EN" method="html" />
	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="/course/title"/>
				</title>
				<link rel="stylesheet" type="text/css" href="course.css"/>
				<meta http-equiv = "Content-type" content = "text/html; charset=iso-8859-1" />
			</head>
			<body>
				<xsl:apply-templates/>
				<p class="validator">
					<a href="http://jigsaw.w3.org/css-validator/check/referer">
  						<img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" />
 					</a>
			      		<a href="http://validator.w3.org/check/referer">
				      		<img src="http://www.w3.org/Icons/valid-html401"
				      		alt="Valid HTML 4.01!" height="31" width="88" />				
					</a>
			   	</p>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="title">
		<h1>
			<xsl:value-of select="."/>
		</h1>
	</xsl:template>
	<xsl:template match="description">
		<h2>
			<xsl:value-of select="."/>
		</h2>
	</xsl:template>
	<xsl:template match="homepage">
		<div>
			<span class="key">Homepage of the course: </span>
			<a>
				<xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
				<xsl:value-of select="."/>
			</a>
		</div>
	</xsl:template>
	<xsl:template match="lecturer">
		<div>
			<span class="key">Lecturer: </span>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="organization">
		<div>
			<span class="key">Organization: </span>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="language">
		<div>
			<span class="key">Language: </span>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="content">
		<p class="key">Content:</p>
		<ul>
			<xsl:apply-templates/>
		</ul>
	</xsl:template>
	<xsl:template match="topic">
		<li>
			<xsl:value-of select="."/>
		</li>
	</xsl:template>
	<xsl:template match="goal">
		<p>
			<span class="key">Goal: </span>
			<xsl:value-of select="."/>
		</p>
	</xsl:template>
	<xsl:template match="schedule">
		<p class="key">Course schedule:</p>
		<table>
			<tbody>
				<tr>
					<th>Date</th>
					<th>Lecture</th>
					<th>Slides</th>
				</tr>
				<xsl:for-each select="event">
					<xsl:sort select="date"/>
					<tr>
						<td>
							<xsl:value-of select="date"/>
						</td>
						<td>
							<xsl:value-of select="title"/>
						</td>
						<td>
							<a>
								<xsl:attribute name="href"><xsl:value-of select="slides"/></xsl:attribute>
								<xsl:value-of select="slides"/>
							</a>							
						</td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>
</xsl:stylesheet>
