c3d2-web/xsl/html.xsl

50 lines
1.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsl">
<xsl:import href="xhtml.xsl" />
<xsl:template name="links">
<link rel="icon" type="image/png" href="../images/favicon.png" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="../news-rss.xml" />
<link rel="alternate" type="application/atom" title="Atom 1.0" href="../news-atom.xml" />
<link rel="stylesheet" title="Default" type="text/css" href="../style/default.css" />
</xsl:template>
<xsl:output method="html"
version="1.0"
encoding="utf-8"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="DTD/xhtml1-strict.dtd"
indent="yes"/>
<xsl:template name="navitem">
<xsl:param name="file"/>
<li>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$file"/>.xml</xsl:attribute>
<xsl:if test="document(concat('../content/', $file, '.xml'))/page/@pagetitle">
<xsl:attribute name="title"><xsl:value-of select="document(concat('../content/', $file, '.xml'))/page/@pagetitle"/></xsl:attribute>
</xsl:if>
<xsl:value-of select="document(concat('../content/', $file, '.xml'))/page/@title"/>
</xsl:element>
</li>
</xsl:template>
<xsl:template name="navitems">
<ul>
<li>
<a href="news.xml" title="News">News</a>
</li>
<xsl:for-each select="document('../content/navigation.xml')/navigation/file">
<xsl:call-template name="navitem">
<xsl:with-param name="file" select="."/>
</xsl:call-template>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>