Upload New File

This commit is contained in:
vv01f - 2019-05-07 07:16:56 +00:00
parent 14392db948
commit 701b91fe0e
1 changed files with 87 additions and 0 deletions

87
rss.xsl Normal file
View File

@ -0,0 +1,87 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" encoding="UTF-8" version="1.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/schleudern">
<!--DOCTYPE rss-->
<!--
</rss>
-->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="https://ds.ccc.de/ds-feed.xml" rel="self" type="application/rss+xml" />
<title>Datenschleuder</title>
<link>https://ds.ccc.de</link>
<description>Das wissenschaftliche Fachblatt für Datenreisende; ein Organ des Chaos Computer Club.</description>
<language>de</language>
<!--copyright></copyright-->
<managingEditor>ds@ccc.de (Redaktion)</managingEditor>
<!--lastBuildDate></lastBuildDate-->
<ttl>65535</ttl>
<image>
<url>https://ds.ccc.de/i/ds_headline.gif</url>
<title>Datenschleuder</title>
<link>https://ds.ccc.de</link>
</image>
<!--
<item>
<title>ds #98</title>
<link>/pdfs/ds098.pdf</link>
<description>Ausgabe #98</description>
</item>
<item>
<title>ds #97</title>
<link>/pdfs/ds097.pdf</link>
<description>Ausgabe #97</description>
</item>
-->
<xsl:for-each select="schleuder">
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="substring(link, string-length(link) - 3) = 'html'">html</xsl:when>
<xsl:when test="substring(link, string-length(link) - 2) = 'pdf'">pdf</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="item">
<!-- we do not have most optional elements -->
<xsl:choose>
<xsl:when test="$type = 'pdf'">
<xsl:element name="guid">
<xsl:attribute name="isPermaLink">true</xsl:attribute>
<xsl:value-of select="concat('https://ds.ccc.de',link)"/>
</xsl:element>
<xsl:element name="enclosure">
<xsl:attribute name="url"><xsl:value-of select="concat('https://ds.ccc.de',link)"/></xsl:attribute>
<xsl:attribute name="length"><xsl:value-of select="filesize"/></xsl:attribute>
<xsl:attribute name="type">application/pdf</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="guid">
<xsl:attribute name="isPermaLink">false</xsl:attribute>
<xsl:value-of select="concat('ds-',@id)"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="title"><xsl:value-of select="concat('Datenschleuder #',@id)"/></xsl:element>
<xsl:element name="link"><xsl:value-of select="concat('https://ds.ccc.de',link)"/></xsl:element>
<xsl:element name="description">
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
<xsl:value-of select="concat('Ausgabe #',@id)"/>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</xsl:element>
<xsl:choose>
<xsl:when test="not(date)"></xsl:when>
<xsl:otherwise><xsl:element name="pubDate"><xsl:value-of select="date"/></xsl:element></xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:for-each>
</channel></rss>
</xsl:template>
</xsl:stylesheet>