c3d2-web/xsl/xhtml.xsl

180 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rss="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:date="http://exslt.org/dates-and-times"
exclude-result-prefixes="xsl rss rdf">
<xsl:include href="common.xsl" />
<xsl:include href="date.xsl" />
<xsl:include href="header.xsl" />
<xsl:include href="footer.xsl" />
<xsl:output method="xml"
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 match="/page">
<xsl:element name="html">
<!--xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute-->
<xsl:attribute name="lang">de</xsl:attribute>
<xsl:attribute name="xml:lang">de</xsl:attribute>
<xsl:element name="head">
<xsl:call-template name="header" />
</xsl:element>
<xsl:element name="body">
<div id="page">
<!-- ### Logo ### -->
<xsl:comment>
<xsl:text> ### Logo ### </xsl:text>
</xsl:comment>
<div id="logo">
<h1>&lt;&lt;&lt;/&gt;&gt; Chaos Computer Club Dresden | c3d2</h1>
</div>
<div id="body">
<!-- ### Navigation ### -->
<xsl:comment>
<xsl:text> ### Navigation ### </xsl:text>
</xsl:comment>
<div id="navigation">
<!-- ### Search ### -->
<xsl:comment>
<xsl:text> ### Search ### </xsl:text>
</xsl:comment>
<form action="http://www.google.de/custom" method="get">
<p>
<input type="text" name="q" size="20" value="c3d2" />
<input type="hidden" name="domains" value="c3d2.de" />
<input type="hidden" name="sitesearch" value="www.c3d2.de" />
<input type="submit" name="submit" value="Suchen!" />
</p>
</form>
<xsl:call-template name="navitems" />
</div> <!-- id="navigation" -->
<!-- ### Content ### -->
<xsl:comment>
<xsl:text> ### Content ### </xsl:text>
</xsl:comment>
<div id="content">
<h2>
<xsl:choose>
<xsl:when test="/page/@pagetitle">
<xsl:value-of select="/page/@pagetitle"/>
</xsl:when>
<xsl:when test="/page/@title">
<xsl:value-of select="/page/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:comment><xsl:text> missing title </xsl:text></xsl:comment>
</xsl:otherwise>
</xsl:choose>
</h2>
<xsl:apply-templates/>
</div> <!-- id="content" -->
<!-- ### News ### -->
<xsl:comment>
<xsl:text> ### News ### </xsl:text>
</xsl:comment>
<xsl:call-template name="chaosupdates" />
</div> <!-- id="body" -->
<!-- ### Footer ### -->
<xsl:comment>
<xsl:text> ### Footer ### </xsl:text>
</xsl:comment>
<div id="footer">
<xsl:call-template name="footer" />
<!-- <p id="update">
<strong>last update:</strong> 02/08/2005 15:15 CEST
</p> -->
</div> <!-- id="footer" -->
<small class="hidden">
Cover, Concealment, Camouflage, Denial and Deception
</small>
</div> <!-- id="page" -->
</xsl:element> <!-- name="body" -->
</xsl:element> <!-- name="html" -->
</xsl:template>
<xsl:template match="news">
<xsl:for-each select="document(newsfile)/item">
<xsl:sort select="date:seconds(@date)" data-type="number" order="descending" />
<h3 class="news"><xsl:value-of select="@title"/></h3>
<small class="news_author">
<xsl:value-of select="@author"/>
</small>
<xsl:variable name="datestring">
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="@date" />
</xsl:call-template>
</xsl:variable>
<xsl:element name="small">
<xsl:attribute name="class">news_date</xsl:attribute>
<xsl:value-of select="concat(' @ ', $datestring)"/>
</xsl:element>
<div class="news">
<xsl:choose>
<!--- <XXX> Kann das hier in ein Template? -->
<xsl:when test="image">
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of select="image"/></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="image/@title"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="image/@title"/></xsl:attribute>
<!-- News-Items haben ihre Bilder abwechselnd rechts und links... -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">
<xsl:text>left</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>right</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<!-- TODO:
<xsl:call-template name="getimage">
<xsl:with-param name="category" select="@category" />
</xsl:call-template>
-->
</xsl:otherwise>
</xsl:choose>
<!-- </XXX> -->
<xsl:apply-templates/>
</div>
<hr class="news"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="item/image">
<!-- Nothing to do here, see above... -->
</xsl:template>
</xsl:stylesheet>