<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<!--*
	* (c) 2003,  German Poo Caaman~o
    * Generate HTML slides 
    *-->

<xsl:output method="html" indent="yes" omit-xml-declaration="no" version="1.0"/>
<xsl:param name="style" select="normal.css"/>


<xsl:template match="talk">
	<html>
		<head>
			<title><xsl:value-of select="slide[1]/title"/></title>
			<link rel="stylesheet" href="{$style}" type="text/css" />
		</head>
		<body>
			<xsl:apply-templates/>
		</body>
	</html>
</xsl:template>

<!--* *-->
<xsl:template match="slide">
	<div class="slide">
		<xsl:apply-templates/>
	</div>
</xsl:template>

<!-- slide mode="ofN" -->
<xsl:template match="slide" mode="ofN">
	<xsl:if test="position() = last()">
		<xsl:value-of select="position()"/>
	</xsl:if>
</xsl:template>

<!-- title -->
<xsl:template match="title">
	<h1><xsl:apply-templates/></h1>
	<div class="head-slide">
		Slide <xsl:number count="slide"/> of
		<xsl:apply-templates select="//slide" mode="ofN"/>
	</div>
</xsl:template>

<xsl:template match="list">
	<ul class="list">
		<xsl:apply-templates/>
	</ul>
</xsl:template>

<xsl:template match="code">
	<div class="code">
		<xsl:apply-templates/>
	</div>
</xsl:template>

<xsl:template match="tt">
	<div class="typewriter">
		<xsl:apply-templates/>
	</div>
</xsl:template>

<!-- item -->
<xsl:template match="item">
	<li><xsl:apply-templates/></li>
</xsl:template>

<!-- image -->
<xsl:template match="image">
	<div class="image">
		<xsl:choose>
			<xsl:when test="@align">
				<xsl:attribute name="align">
					<xsl:value-of select="@align"/>
				</xsl:attribute>
			</xsl:when>
			<xsl:otherwise>
				<xsl:attribute name="align">
					<xsl:value-of select="'center'"/>
				</xsl:attribute>
			</xsl:otherwise>
		</xsl:choose>
	<img>
		<xsl:attribute name="src">
			<xsl:value-of select="current()"/>
		</xsl:attribute>
	</img>
	</div>
</xsl:template>

<!-- run -->
<xsl:template match="run">
	<!-- It doesn't make sense -->
</xsl:template>

</xsl:stylesheet>
