old-website/xsl/directory.xsl

42 lines
1.2 KiB
XML
Raw Normal View History

<?xml version='1.0'?>
2007-08-11 04:26:38 -04:00
<xsl:stylesheet version="2.0"
2007-08-11 05:24:19 -04:00
xmlns="http://www.w3.org/1999/xhtml"
2007-08-11 04:26:38 -04:00
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:csc="http://csclub.uwaterloo.ca/xslt">
<xsl:template match="directory">
<xsl:variable name="href">
<xsl:choose>
<xsl:when test="@href != ''"><xsl:value-of select="@href"/></xsl:when>
<xsl:otherwise>index.html</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="@title">
<a class="diritem homedir" href="{$pre}">Home</a>
<a class="diritem" href="{$href}">
<xsl:value-of select="@title" />
</a>
</xsl:if>
2007-08-11 04:26:38 -04:00
<xsl:apply-templates select="diritem" />
</xsl:template>
2007-09-19 04:43:46 -04:00
<xsl:template name="diritem">
<xsl:param name="title" />
<xsl:param name="href" />
<a class="diritem" href="{$href}">
<xsl:value-of select="$title" />
</a>
</xsl:template>
2007-09-19 04:43:46 -04:00
<xsl:template match="diritem">
<xsl:call-template name="diritem">
<xsl:with-param name="title" select="@title" />
<xsl:with-param name="href" select="@href" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>