c3d2-web/xsl/atom.xsl

53 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:crypto="http://exslt.org/crypto"
exclude-result-prefixes="xsl">
<xsl:include href="common.xsl" />
<xsl:output method="xml"
version="1.0"
encoding="utf-8"
indent="yes"/>
<xsl:variable name="baseurl"/>
<xsl:template match="news">
<xsl:element name="feed">
<xsl:attribute name="xmlns">http://www.w3.org/2005/Atom</xsl:attribute>
<xsl:attribute name="xml:lang">de</xsl:attribute>
<title>www.c3d2.de Newsfeed</title>
<link rel="self" href="https://www.c3d2.de/news-atom.xml" />
<id>http://www.c3d2.de/</id>
<description>Neues aus dem Chaos Computer Club Dresden</description>
<language>de-de</language>
<!-- XXX
<pubDate><xsl:value-of select="news/item/@date"/></pubDate>
-->
<xsl:for-each select="document(newsfile)/item">
<xsl:sort select="date:seconds(@date)" data-type="number" order="descending" />
<entry>
<id><xsl:value-of select="crypto:sha1(concat(@title,@date))"/></id>
<title><xsl:value-of select="@title"/></title>
<updated><xsl:value-of select="@date"/></updated>
<author>
<name><xsl:value-of select="@author"/></name>
</author>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates/>
</div>
</content>
</entry>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>