<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Id: html.xsl,v 1.4 2004/10/17 12:13:39 eric Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
	<xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
	<xsl:template match="faq">
		<html>
			<head>
				<title>Dutch Power Cows :: <xsl:value-of select="title" /></title>
				<link href="faq.css" rel="stylesheet" type="text/css" />
			</head>
			<body>
				<table>
					<tr>
						<td>
							<img alt="Logo" src="logo.png" />
						</td>
						<td style="vertical-align: middle;">
							<div class="title">
								<xsl:value-of select="title" />
							</div>
							<div class="subtitle">
								<xsl:value-of select="subtitle" />
							</div>
						</td>
					</tr>
				</table>
				<h2>Inhoudsopgave</h2>
				<ol>
					<xsl:apply-templates select="section" mode="toc" />
				</ol>
				<xsl:apply-templates select="section" mode="content" />
				<hr />
				<table width="100%">
					<tr>
						<td>
							<div class="footer">Deze FAQ wordt bijgehouden door: <xsl:apply-templates select="maintainer" /></div>
						</td>
						<td style="text-align: right;">
							<div class="footer"><xsl:value-of select="revision" /></div>
						</td>
					</tr>
				</table>
			</body>
		</html>
	</xsl:template>
	<!-- Definition of markup codes -->
	<xsl:template match="comment">
		<i><xsl:apply-templates /></i>
	</xsl:template>
	<xsl:template match="emphasize">
		<b><xsl:apply-templates /></b>
	</xsl:template>
	<xsl:template match="example">
		<pre><xsl:value-of select="." /></pre>
	</xsl:template>
	<xsl:template match="br">
		<br />
	</xsl:template>
	<xsl:template match="image">
		<img alt="{@text}" src="{.}" style="border-width: 0px;" />
	</xsl:template>
	<xsl:template match="item">
		<xsl:choose>
			<xsl:when test="not(@title)">
				<li><xsl:apply-templates /></li>
			</xsl:when>
			<xsl:otherwise>
				<li><b><xsl:value-of select="@title" />:</b><xsl:text> </xsl:text><xsl:apply-templates /></li>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="link">
		<xsl:choose>
			<xsl:when test="not(@url)">
				<a href="{.}"><xsl:value-of select="." /></a>
			</xsl:when>
			<xsl:otherwise>
				<a href="{@url}"><xsl:value-of select="." /></a>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="mail">
		<xsl:choose>
			<xsl:when test="not(@address)">
				<a href="mailto:{.}"><xsl:value-of select="." /></a>
			</xsl:when>
			<xsl:otherwise>
				<a href="mailto:{@address}"><xsl:value-of select="." /></a>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="list">
		<ul><xsl:apply-templates /></ul>
	</xsl:template>
	<xsl:template match="p">
		<p><xsl:apply-templates /></p>
	</xsl:template>
	<!-- These are empty, we explicitly select them instead of using apply-templates -->
	<xsl:template match="section" />

	<!-- Table of contents -->

	<xsl:template match="section" mode="toc">
		<li>
			<xsl:choose>
				<xsl:when test="not(@id)">
					<a href="#{generate-id()}"><xsl:value-of select="@title" /></a>
				</xsl:when>
				<xsl:otherwise>
					<a href="#{@id}"><xsl:value-of select="@title" /></a>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:if test="section">
				<ol>
					<xsl:apply-templates select="section" mode="toc" />
				</ol>
			</xsl:if>
		</li>
	</xsl:template>

	<!-- Content itself -->

	<xsl:template match="section" mode="content">
		<xsl:variable name="headtype">
			<xsl:choose>
				<xsl:when test="count(ancestor-or-self::section) = 1">
					<xsl:text>h2</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>h3</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:element name="{$headtype}">
			<xsl:value-of select="@title" />
			<xsl:choose>
				<xsl:when test="not(@id)">
					<a name="{generate-id()}"><xsl:text> </xsl:text></a>
				</xsl:when>
				<xsl:otherwise>
					<a name="{@id}"><xsl:text> </xsl:text></a>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:element>
		<div class="indent">
			<xsl:apply-templates />
			<xsl:apply-templates select="section" mode="content" />
		</div>
	</xsl:template>
</xsl:stylesheet>

