<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
	<xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
	<!-- geändert nach Christian Süß (Universität Passau) 
 --><xsl:param name="resources" select="''"/>
	<!-- ============================= lmml template (root) ================================= -->
	<xsl:template match="/">
		<html>
			<head>
				<!-- MS Internetexplorer zeigt HTML-Seite mit leerem <title></title> nicht an -->
				<xsl:if test="@title">
					<title>
						<xsl:value-of select="@title"/>
					</title>
				</xsl:if>
			</head>
			<body>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>
	<!-- ==================================== modules: structure modules ================================-->
	<!-- ==================================== top level section ================================-->
	<xsl:template match="/section|/result/section">
		<hr/>
		<center>
			<H1>
				<font face="Arial">
					<xsl:value-of select="@title"/>
				</font>
			</H1>
		</center>
		<hr/>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- ==================================== nested sections ================================-->
	<xsl:template match="section">
		<xsl:choose>
			<xsl:when test="not(@style='slide')">
				<xsl:if test="@title">
					<h3>
						<font face="Arial">
							<xsl:value-of select="@title"/>
						</font>
					</h3>
				</xsl:if>
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!-- glossary -->
	<xsl:template match="glossary">
		<xsl:choose>
			<xsl:when test="@uri">
				<a>
					<xsl:attribute name="href"><xsl:value-of select="@uri"/></xsl:attribute>
					<H2>
						<xsl:value-of select="@title"/>
					</H2>
					<xsl:apply-templates/>
				</a>
			</xsl:when>
			<!-- Sortieren von Definitionen innerhalb eines Glossars -->
			<xsl:when test="definition">
			<H2>
					<xsl:value-of select="@title"/>
				</H2>
				<xsl:apply-templates>
					<xsl:sort select="@title"/>
				</xsl:apply-templates>
			</xsl:when>		
			<xsl:otherwise>
				<xsl:if test="@label">
					<a>
						<xsl:attribute name="name"><xsl:value-of select="@label"/></xsl:attribute>
					</a>
				</xsl:if>
				<H2>
					<xsl:value-of select="@title"/>
				</H2>
				<xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!-- bibliography -->
	<xsl:template match="bibliography">
		<xsl:if test="@label">
			<a>
				<xsl:attribute name="name"><xsl:value-of select="@label"/></xsl:attribute>
			</a>
		</xsl:if>
		<h1>Literatur</h1>
		<xsl:for-each select="bibItem">
			<table width="100%" border="0">
				<tr>
					<td width="10%">
						<a>
							<xsl:attribute name="name"><xsl:value-of select="@bibKey"/></xsl:attribute>
						</a>
						<xsl:value-of select="@bibKey"/>
					</td>
					<td>
						<xsl:apply-templates/>
					</td>
				</tr>
			</table>
		</xsl:for-each>
	</xsl:template>
	<!-- root collection -->
	<xsl:template match="lmml/collection">
		<center>
			<H1>
				<xsl:value-of select="@title"/>
			</H1>
			<xsl:if test="/lmml/collection/section/@label">
				<table cellspacing="10">
					<tr>
						<xsl:for-each select="section">
							<xsl:if test="@label">
								<td>
									<a>
										<xsl:attribute name="href">#<xsl:value-of select="@label"/></xsl:attribute>
										<font size="-2">
											<xsl:value-of select="@title"/>
										</font>
									</a>
								</td>
							</xsl:if>
						</xsl:for-each>
					</tr>
				</table>
			</xsl:if>
		</center>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- nested collections -->
	<xsl:template match="collection">
		<xsl:choose>
			<xsl:when test="@uri">
				<a>
					<xsl:attribute name="href"><xsl:value-of select="@uri"/></xsl:attribute>
					<H2>
						<xsl:text>Anhang </xsl:text>
						<xsl:value-of select="@title"/>
					</H2>
					<xsl:apply-templates/>
				</a>
			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="@label">
					<a>
						<xsl:attribute name="name"><xsl:value-of select="@label"/></xsl:attribute>
					</a>
				</xsl:if>
				<H2>
					<xsl:value-of select="@title"/>
				</H2>
				<xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!-- ==================================== content modules =============================-->
	<!-- ==================================== paragraph =====================-->
	<xsl:template match="paragraph">
		<xsl:if test="@title">
			<h3>
				<xsl:value-of select="@title"/>
			</h3>
		</xsl:if>
		<p>
			<xsl:apply-templates/>
		</p>
	</xsl:template>
	<!-- ==================================== illustration =====================-->
	<xsl:template match="illustration">
		<p>
			<xsl:apply-templates/>
		</p>
	</xsl:template>
	<!-- ==================================== remark ========================-->
	<xsl:template match="remark">
		<h3>Bemerkung: <xsl:value-of select="@title"/>
		</h3>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- ==================================== definition ========================-->
	<xsl:template match="definition">
		<b>
			<xsl:value-of select="@title"/>
		</b>
		<br/>
		<xsl:apply-templates/>
		<br/>
		<br/>
	</xsl:template>
	<!-- ==================================== example ========================-->
	<xsl:template match="example">
		<h3>Beispiel: <xsl:value-of select="@title"/>
		</h3>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- mit Nummerierung 
	<xsl:template match="example">
		<xsl:choose>
		<xsl:when test="@uri">
			<a>
				<xsl:attribute name="href"><xsl:value-of select="@uri"/></xsl:attribute>
				<h3>
					<xsl:number level="multiple" count="example" format="1"/><xsl:text> </xsl:text><xsl:value-of select="@title"/>
				</h3>
				<xsl:apply-templates/>
			</a>
		</xsl:when>
		<xsl:otherwise>
			<h3>
				 <xsl:number level="multiple" count="example" format="1"/><xsl:text> </xsl:text><xsl:value-of select="@title"/>
			</h3>
			<xsl:apply-templates/>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	-->
	<!-- ==================================== content strucutre =============================-->
	<!--================================ ulist =============================== -->
	<xsl:template match="ulist">
		<xsl:value-of select="@title"/>
		<ul>
			<xsl:apply-templates/>
		</ul>
	</xsl:template>
	<!--================================ olist =============================== -->
	<xsl:template match="olist">
		<xsl:value-of select="@title"/>
		<ol>
			<xsl:apply-templates/>
		</ol>
	</xsl:template>
	<!--================================ item ==================== -->
	<xsl:template match="item">
		<li>
			<xsl:apply-templates/>
		</li>
	</xsl:template>
	<!-- ================================ table ===============================-->
	<xsl:template match="table">
		<p>
			<center>
				<table>
					<xsl:choose>
						<xsl:when test="@style = 'attr-table'">
							<xsl:attribute name="border"/>
							<xsl:attribute name="width">100%</xsl:attribute>
							<colgroup>
								<col width="15%"/>
								<col width="30%"/>
								<col width="30%"/>
								<col width="25%"/>
							</colgroup>
							<tr>
								<th valign="top" width="15%">Name</th>
								<th valign="top" width="35%">Beschreibung</th>
								<th width="25%">Wertebereich</th>
								<th width="25%">Beispiel</th>
							</tr>
						</xsl:when>
						<xsl:when test="@style = 'elem-table'">
							<xsl:attribute name="border"/>
							<xsl:attribute name="width">100%</xsl:attribute>
							<colgroup>
								<col width="20%"/>
								<col width="40%"/>
								<col width="40%"/>
							</colgroup>
							<tr>
								<th>Elementname</th>
								<th>Minimaler Inhalt (content model)</th>
								<th>Bemerkung</th>
							</tr>
						</xsl:when>
						<xsl:when test="@style = 'lmml-table'">
							<xsl:attribute name="width">70%</xsl:attribute>
							<xsl:attribute name="cellpadding">2</xsl:attribute>
							<xsl:attribute name="bgcolor">#FFFFE0</xsl:attribute>
							<colgroup>
								<col width="50%"/>
								<col width="50%"/>
							</colgroup>
						</xsl:when>
						<xsl:when test="@style = 'attribut-table'">
							<xsl:attribute name="width">70%</xsl:attribute>
							<xsl:attribute name="cellpadding">2</xsl:attribute>
							<xsl:attribute name="bgcolor">#FFFFE0</xsl:attribute>
							<colgroup>
								<col width="50%"/>
								<col width="50%"/>
							</colgroup>
							<tr>
								<th>Attribut/Attributgruppe</th>
								<th>Angabe</th>
							</tr>
						</xsl:when>
						<xsl:when test="@style = 'meaning-table'">
							<xsl:attribute name="border">0</xsl:attribute>
							<xsl:attribute name="width">70%</xsl:attribute>
							<xsl:attribute name="cellpadding">2</xsl:attribute>
							<xsl:attribute name="bgcolor">#FFFFE0</xsl:attribute>
							<colgroup>
								<col width="20%"/>
								<col width="50%"/>
								<col width="30%"/>
							</colgroup>
						</xsl:when>
						<xsl:otherwise>
							<xsl:attribute name="align">center</xsl:attribute>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:apply-templates/>
				</table>
			</center>
		</p>
	</xsl:template>
	<!--=================================== tableheading -tablerow ====-->
	<xsl:template match="tableheading | tablerow">
		<tr>
			<xsl:apply-templates/>
		</tr>
	</xsl:template>
	<!-- =================================== tablerow/tabledata ========-->
	<xsl:template match="tablerow/tabledata">
		<td valign="top">
			<xsl:apply-templates/>
		</td>
	</xsl:template>
	<!-- ================================= tableheading/tabledata =====-->
	<xsl:template match="tableheading/tabledata">
		<th>
			<xsl:apply-templates/>
		</th>
	</xsl:template>
	<!-- ==================================== media objects =============================-->
	<!-- ==================================== image ========================-->
	<xsl:template match="image">
		<center>
			<img src="{$resources}bilder/{@uri}"/>
		</center>
	</xsl:template>
	<!-- ==================================== text ==========================-->
	<xsl:template match="text">
		<xsl:choose>
			<xsl:when test="self::node()[@type ='text/xhtml']">
				<xsl:value-of disable-output-escaping="yes" select="."/>
			</xsl:when>
			<xsl:when test="self::node()[@type ='text/latex']">
				<EMBED TYPE="application/x-techexplorer" height="200" width="800">
					<xsl:attribute name="TEXDATA"><xsl:value-of select="."/></xsl:attribute>
				</EMBED>
			</xsl:when>
			<xsl:when test="self::node()[@type ='text/image']">
				<img>
					<xsl:attribute name="src"><xsl:value-of select="@uri"/></xsl:attribute>
				</img>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<!-- ==================================== formatted==========================-->
	<xsl:template match="formatted">
		<xsl:choose>
			<xsl:when test="@style ='element'">
				<font face="Arial" size="-1">
					<xsl:apply-templates/>
				</font>
			</xsl:when>
			<xsl:when test="@style ='attribut'">
				<font face="Courier">
					<xsl:apply-templates/>
				</font>
			</xsl:when>
			<xsl:when test="@style ='cmd'">
				<code>
					<xsl:apply-templates/>
				</code>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<!-- ==================================== formula =======================-->
	<xsl:template match="formula">
		<H2>Formel: <xsl:value-of select="@title"/>
		</H2>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- ==================================== math =========================-->
	<xsl:template priority="0" match="math">
		<xsl:choose>
			<xsl:when test="self::node()[@type ='text/mathml']">
				<EMBED TYPE="application/x-techexplorer" height="200" width="800">
					<xsl:attribute name="MMLDATA"><xsl:value-of select="."/></xsl:attribute>
				</EMBED>
			</xsl:when>
			<xsl:when test="self::node()[@type ='text/latex']">
				<EMBED TYPE="application/x-techexplorer" height="200" width="800">
					<xsl:attribute name="TEXDATA"><xsl:value-of select="."/></xsl:attribute>
				</EMBED>
			</xsl:when>
			<xsl:when test="self::node()[@type ='image/gif']">
				<p>
					<img>
						<xsl:attribute name="src"><xsl:value-of select="@uri"/></xsl:attribute>
					</img>
				</p>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<!-- ==================================== algorithm ======================-->
	<xsl:template match="algorithm">
		<H2>
			<xsl:value-of select="@title"/>
		</H2>
		<xsl:apply-templates/>
	</xsl:template>
	<!-- ==================================== code =========================-->
	<xsl:template match="code">
		<font>
			<xsl:apply-templates/>
		</font>
	</xsl:template>
	<!-- ==================================== LMMLcode =========================-->
	<xsl:template match="LMMLcode">
		<b>
			<xsl:apply-templates/>
		</b>
	</xsl:template>
	<!-- ==================================== text: LMMLtext ==================-->
	<xsl:template match="LMMLtext">
		<xsl:apply-templates/>
		<br/>
	</xsl:template>
	<!-- ==================================== emphasized ========-->
	<xsl:template match="emphasized">
		<b>
			<xsl:apply-templates/>
		</b>
	</xsl:template>
	<!-- ==================================== math in LMMLtext ====-->
	<xsl:template priority="1" match="LMMLtext/math">
		<EMBED TYPE="application/x-techexplorer" height="60" width="200" ALIGN="ABSMIDDLE">
			<xsl:choose>
				<xsl:when test="self::node()[@type ='text/mathml']">
					<xsl:attribute name="MMLDATA"><xsl:value-of select="."/></xsl:attribute>
				</xsl:when>
				<xsl:when test="self::node()[@type ='text/latex']">
					<xsl:attribute name="TEXDATA"><xsl:value-of select="."/></xsl:attribute>
				</xsl:when>
				<xsl:when test="self::node()[@type ='image/gif']">
					<img>
						<xsl:attribute name="src"><xsl:value-of select="@uri"/></xsl:attribute>
					</img>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="."/>
				</xsl:otherwise>
			</xsl:choose>
		</EMBED>
	</xsl:template>
	<!-- ===================================== code in LMMLtext  ====-->
	<xsl:template priority="1" match="LMMLtext/code">
		<code>
			<xsl:value-of select="."/>
		</code>
	</xsl:template>
	<!-- ====================================== listing =============-->
	<xsl:template match="listing">
		<pre>
			<xsl:apply-templates/>
		</pre>
	</xsl:template>
	<xsl:template match="block">
		<pre>
			<xsl:attribute name="style">margin-left:0.5cm;</xsl:attribute>
			<xsl:apply-templates/>
		</pre>
	</xsl:template>
	<xsl:template match="line">
		<xsl:value-of select="."/>
		<br/>
	</xsl:template>
	<!-- ====================================== links =============================-->
	<!-- ====================================== referencesLink ===========-->
	<!-- ====================================== externalLink ===========-->
	<xsl:template match="externalLink ">
		<a>
			<xsl:attribute name="href"><xsl:value-of select="@uri"/></xsl:attribute>
			<xsl:if test="@show='new'">
				<xsl:attribute name="target">_blank</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="."/>
		</a>
	</xsl:template>
	<!-- ====================================== citesLink ===========-->
</xsl:stylesheet>

