36f8131165
git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@372 31f61c52-7bfb-0310-b897-fc00f8a278f0
62 lines
2.1 KiB
XML
62 lines
2.1 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 crypto date">
|
|
|
|
<xsl:include href="common.xsl" />
|
|
|
|
<xsl:output method="xml"
|
|
version="1.0"
|
|
encoding="utf-8"
|
|
indent="yes"/>
|
|
|
|
<xsl:variable name="baseurl">https://www.c3d2.de/</xsl:variable>
|
|
|
|
<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="newsfile">
|
|
<xsl:sort select="date:seconds(document(.)/@date)" data-type="number" order="descending" />
|
|
<xsl:variable name="newsfile" select="."/>
|
|
|
|
<xsl:for-each select="document(.)/item">
|
|
<xsl:call-template name="atom-entry">
|
|
<xsl:with-param name="newsfile" select="$newsfile"/>
|
|
</xsl:call-template>
|
|
</xsl:for-each>
|
|
</xsl:for-each>
|
|
</xsl:element>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="atom-entry">
|
|
<xsl:param name="newsfile"/>
|
|
<entry>
|
|
<id><xsl:value-of select="crypto:sha1(concat(@title,@date))"/></id>
|
|
<title><xsl:value-of select="@title"/></title>
|
|
<link href="{$baseurl}{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html"/>
|
|
<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:template>
|
|
</xsl:stylesheet>
|