2021-04-02 18:09:38 +02:00
<xsl:stylesheet encoding= "UTF-8" version= "1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<!-- xmlns:exsltstr="http://exslt.org/strings" -->
<!-- xmlns:date="http://exslt.org/dates - and - times" extension - element - prefixes="date" -->
2019-05-07 09:16:56 +02:00
<xsl:output omit-xml-declaration= "yes" />
2021-04-02 18:09:38 +02:00
<!-- xsl:output method="xml" indent="yes" encoding="utf - 8"/ -->
<!-- xmlns:dc="http://purl.org/dc/elements/1.1/" -->
2019-05-07 09:16:56 +02:00
<xsl:template match= "/schleudern" >
<!-- DOCTYPE rss -->
2021-04-02 18:09:38 +02:00
<xsl:text disable-output-escaping= "yes" > < ?xml version="1.0" encoding="UTF-8"?> </xsl:text> <xsl:text > </xsl:text>
<xsl:text disable-output-escaping= "yes" > < ?xml-stylesheet type="text/css" href="https://ds.ccc.de/style-rss.css"?> </xsl:text> <xsl:text > </xsl:text>
<rss version= "2.0" xmlns:atom= "http://www.w3.org/2005/Atom" > <xsl:text > </xsl:text>
<xsl:text > </xsl:text>
<channel > <xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
<xsl:variable name= "limitenclosures" > 0</xsl:variable> <!-- 0:no limit, 1:limit is one -->
<xsl:variable name= "protocol" > https://</xsl:variable>
<xsl:variable name= "baseurl" > ds.ccc.de</xsl:variable>
2021-11-10 20:42:29 +01:00
<xsl:variable name= "feedfile" > ds-feed.xml</xsl:variable>
2021-04-02 18:09:38 +02:00
<title > Datenschleuder</title>
<xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
<xsl:element name= "atom:link" >
2021-04-02 18:09:38 +02:00
<xsl:attribute name= "rel" > self</xsl:attribute> <!-- when atom url is rss url -->
2021-11-10 20:42:29 +01:00
<xsl:attribute name= "href" > <xsl:value-of select= "concat($protocol,$baseurl,'/',$feedfile)" /> </xsl:attribute>
2019-06-12 23:48:42 +02:00
<xsl:attribute name= "type" > application/rss+xml</xsl:attribute>
</xsl:element>
2021-04-02 18:09:38 +02:00
<xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
<!--
2019-05-07 09:16:56 +02:00
<atom:link href= "https://ds.ccc.de/ds-feed.xml" rel= "self" type= "application/rss+xml" />
2019-06-12 23:48:42 +02:00
-->
2021-04-02 18:09:38 +02:00
<xsl:element name= "link" > <xsl:value-of select= "concat($protocol,$baseurl,'/')" /> </xsl:element> <!-- <link>https://ds.ccc.de</link> -->
<xsl:text > 	 </xsl:text>
<description > Das wissenschaftliche Fachblatt für Datenreisende; ein Organ des Chaos Computer Club.</description>
<xsl:text > 	 </xsl:text>
<lastBuildDate > <xsl:value-of select= "$current-date" /> </lastBuildDate>
<xsl:text > 	 </xsl:text>
<!-- lastBuildDate>Tue, 30 Mar 2021 10:27:18 +0000</lastBuildDate -->
<!-- <xsl:value - of select="date:date - time()"/> -->
<!-- # \ - \ - stringparam current - date `date +%Y - %m - %d` # possibility for current date - time - group via XSLT <xsl:value - of select="$current - date"/> -->
<language > de</language>
<xsl:text > 	 </xsl:text>
<!-- copyright></copyright -->
<managingEditor > ds@ccc.de (Redaktion)</managingEditor>
<xsl:text > 	 </xsl:text>
<!-- webMaster>ds@ccc.de</webMaster -->
<ttl > 65535</ttl>
<xsl:text > 	 </xsl:text>
<image >
<xsl:element name= "url" > <xsl:value-of select= "concat($protocol,$baseurl,'/i/ds_headline.gif')" /> </xsl:element> <!-- <url>https://ds.ccc.de</url> -->
<title > Datenschleuder</title>
<xsl:element name= "link" > <xsl:value-of select= "concat($protocol,$baseurl,'/')" /> </xsl:element>
</image>
<xsl:text > 	 </xsl:text>
2019-05-07 09:16:56 +02:00
<!--
<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" >
2019-06-12 23:48:42 +02:00
<!--
<xsl:for-each select= "catalog/cd" >
-->
2019-05-07 09:16:56 +02:00
<xsl:element name= "item" >
2021-04-02 18:09:38 +02:00
<xsl:text > 	 </xsl:text>
2019-05-07 09:16:56 +02:00
<!-- we do not have most optional elements -->
<xsl:element name= "title" > <xsl:value-of select= "concat('Datenschleuder #',@id)" /> </xsl:element>
2021-04-08 10:22:00 +02:00
<xsl:text > 	 	 </xsl:text>
2021-04-02 18:09:38 +02:00
<xsl:choose >
<xsl:when test= "not(date)" > </xsl:when>
2021-04-08 10:22:00 +02:00
<xsl:otherwise > <xsl:element name= "pubDate" > <xsl:value-of select= "date" /> </xsl:element> <xsl:text > 	 	 </xsl:text> </xsl:otherwise>
2021-04-02 18:09:38 +02:00
</xsl:choose>
2019-06-12 23:48:42 +02:00
2019-05-07 09:16:56 +02:00
<xsl:element name= "description" >
2021-04-02 18:09:38 +02:00
<xsl:text disable-output-escaping= "yes" > < ![CDATA[</xsl:text>
2022-07-13 23:01:41 +02:00
<xsl:element name= "h3" > <xsl:value-of select= "concat('Ausgabe #',@id)" /> </xsl:element>
<xsl:element name= "div" > <p > <xsl:value-of select= "teaser" /> </p>
2019-06-12 23:48:42 +02:00
<xsl:if test= "string-length(image) > 0" >
<xsl:element name= "img" > <xsl:attribute name= "src" >
<xsl:value-of select= "concat($protocol,$baseurl,'/',image)" /> </xsl:attribute>
2022-07-13 23:01:41 +02:00
</xsl:element> <xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:if>
2022-07-13 23:01:41 +02:00
<xsl:element name= "ul" >
<xsl:if test= "string-length(preface) > 0" >
<li > <xsl:element name= "a" > <xsl:attribute name= "href" > <xsl:value-of select= "concat($protocol,$baseurl,'/',preface)" /> </xsl:attribute> Geleitwort</xsl:element> </li>
<xsl:text > 	 	 </xsl:text>
</xsl:if>
<xsl:if test= "string-length(references) > 0" >
<li > <xsl:element name= "a" > <xsl:attribute name= "href" > <xsl:value-of select= "concat($protocol,$baseurl,'/',references)" /> </xsl:attribute> Referenzen zur Ausgabe</xsl:element> </li>
<xsl:text > 	 	 </xsl:text>
</xsl:if>
2022-10-09 23:09:00 +02:00
<xsl:for-each select= "link" > <!-- files to link, bit maybe not add as enclosure -->
2022-07-13 23:01:41 +02:00
<!--
2019-06-12 23:48:42 +02:00
<xsl:if test= "((position() > 1) and ($limitenclosures = 1))" >
2022-07-13 23:01:41 +02:00
-->
<xsl:variable name= "type" >
<xsl:choose >
<xsl:when test= "substring(., string-length(.) - 2) = 'pdf'" > PDF</xsl:when>
2022-10-09 17:23:54 +02:00
<xsl:when test= "substring(., string-length(.) - 2) = 'zip'" > ZIP</xsl:when>
2022-07-13 23:01:41 +02:00
<xsl:when test= "substring(., string-length(.) - 3) = 'html'" > HTML</xsl:when>
<xsl:when test= "substring(., string-length(.) - 3) = 'epub'" > ePUB</xsl:when>
2022-10-09 23:09:00 +02:00
<xsl:when test= "substring(., string-length(.) - 6) = 'torrent'" > Torrent</xsl:when>
2022-07-13 23:01:41 +02:00
<xsl:otherwise > unknown</xsl:otherwise>
</xsl:choose>
</xsl:variable>
2019-06-12 23:48:42 +02:00
<xsl:text disable-output-escaping= "yes" > </xsl:text>
2022-07-13 23:01:41 +02:00
<li > <xsl:element name= "a" > <xsl:attribute name= "href" > <xsl:value-of select= "concat($protocol,$baseurl,'/',.)" /> </xsl:attribute> <xsl:value-of select= "concat($type,'-Datei')" /> </xsl:element> </li>
<!--
2019-06-12 23:48:42 +02:00
</xsl:if>
2022-07-13 23:01:41 +02:00
-->
2019-06-12 23:48:42 +02:00
</xsl:for-each>
2022-07-13 23:01:41 +02:00
</xsl:element> <!-- /ul -->
2019-06-12 23:48:42 +02:00
2022-07-13 23:01:41 +02:00
</xsl:element> <!-- /div -->
2021-04-08 10:22:00 +02:00
2021-04-02 18:09:38 +02:00
<xsl:text disable-output-escaping= "yes" > ]]> </xsl:text>
2019-05-07 09:16:56 +02:00
</xsl:element>
2021-04-08 10:22:00 +02:00
<xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
<xsl:variable name= "id" >
<xsl:value-of select= "@id" />
</xsl:variable>
<xsl:for-each select= "link" >
<xsl:variable name= "position" >
<xsl:value-of select= "position()" />
2021-04-02 18:09:38 +02:00
</xsl:variable>
2019-06-12 23:48:42 +02:00
<xsl:variable name= "href" >
2021-11-10 20:42:29 +01:00
<xsl:value-of select= "concat($protocol,$baseurl,'/',.)" />
2019-06-12 23:48:42 +02:00
</xsl:variable>
<xsl:variable name= "filesize" >
<xsl:choose >
<xsl:when test= "string-length(@filesize) > 0" >
<xsl:value-of select= "@filesize" />
</xsl:when>
<xsl:otherwise >
2021-04-02 18:09:38 +02:00
<xsl:value-of select= "../filesize" /> <!-- todo: if not available lenth="0" -->
2019-06-12 23:48:42 +02:00
</xsl:otherwise>
</xsl:choose>
2021-04-02 18:09:38 +02:00
</xsl:variable>
2019-06-12 23:48:42 +02:00
<xsl:variable name= "type" >
<xsl:choose >
<xsl:when test= "substring($href, string-length($href) - 2) = 'pdf'" > pdf</xsl:when>
2022-10-09 17:23:54 +02:00
<xsl:when test= "substring($href, string-length($href) - 2) = 'zip'" > zip</xsl:when>
2019-06-12 23:48:42 +02:00
<xsl:when test= "substring($href, string-length($href) - 3) = 'html'" > html</xsl:when>
<xsl:when test= "substring($href, string-length($href) - 3) = 'epub'" > epub</xsl:when>
2022-10-09 23:09:00 +02:00
<xsl:when test= "substring($href, string-length($href) - 6) = 'torrent'" > torrent</xsl:when>
2019-06-12 23:48:42 +02:00
<xsl:otherwise > unknown</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test= "$position = 1" >
<xsl:if test= "$type != 'html'" >
<xsl:element name= "guid" >
<xsl:attribute name= "isPermaLink" > true</xsl:attribute>
<xsl:value-of select= "$href" />
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:if>
<xsl:if test= "$type = 'html'" >
<xsl:element name= "guid" >
<xsl:attribute name= "isPermaLink" > true</xsl:attribute>
<xsl:value-of select= "concat('https://www.offiziere.ch/trust-us/ds/',substring($id, 0, 3))" />
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:if>
<xsl:element name= "link" >
<xsl:value-of select= "$href" />
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:if>
<xsl:if test= "((($position > 1) and ($limitenclosures = 0)) or ($position = 1))" >
<xsl:choose >
<xsl:when test= "$type = 'pdf'" >
<xsl:element name= "enclosure" >
<xsl:attribute name= "url" > <xsl:value-of select= "$href" /> </xsl:attribute>
<xsl:attribute name= "length" > <xsl:value-of select= "$filesize" /> </xsl:attribute>
<xsl:attribute name= "type" > application/pdf</xsl:attribute>
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:when>
<xsl:when test= "$type = 'epub'" >
<xsl:element name= "enclosure" >
<xsl:attribute name= "url" > <xsl:value-of select= "$href" /> </xsl:attribute>
<xsl:attribute name= "length" > <xsl:value-of select= "$filesize" /> </xsl:attribute>
<xsl:attribute name= "type" > application/epub+zip</xsl:attribute>
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:when>
2022-10-09 23:09:00 +02:00
<!--
2022-10-09 17:23:54 +02:00
<xsl:when test= "$type = 'zip'" >
<xsl:element name= "enclosure" >
<xsl:attribute name= "url" > <xsl:value-of select= "$href" /> </xsl:attribute>
<xsl:attribute name= "length" > <xsl:value-of select= "$filesize" /> </xsl:attribute>
<xsl:attribute name= "type" > application/zip</xsl:attribute>
2022-10-09 23:09:00 +02:00
</xsl:element> <xsl:text > 	 </xsl:text>
</xsl:when>
-->
<xsl:when test= "$type = 'torrent'" >
<xsl:element name= "enclosure" >
<xsl:attribute name= "url" > <xsl:value-of select= "$href" /> </xsl:attribute>
<xsl:attribute name= "length" > <xsl:value-of select= "$filesize" /> </xsl:attribute>
<xsl:attribute name= "type" > application/octet-stream</xsl:attribute>
2022-10-09 17:23:54 +02:00
</xsl:element> <xsl:text > 	 </xsl:text>
</xsl:when>
2019-06-12 23:48:42 +02:00
<xsl:otherwise >
2022-10-09 17:23:54 +02:00
<xsl:element name= "enclosure" >
<xsl:attribute name= "url" > <xsl:value-of select= "$href" /> </xsl:attribute>
<xsl:attribute name= "length" > <xsl:value-of select= "$filesize" /> </xsl:attribute>
<xsl:attribute name= "type" > application/octet-stream</xsl:attribute>
</xsl:element> <xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:if test= "count(link) = 0" >
<xsl:element name= "guid" >
<xsl:attribute name= "isPermaLink" > true</xsl:attribute>
<!--
<xsl:value-of select= "concat($protocol,$baseurl,'/#',exsltstr:encode-uri(@id, 'true', 'UTF-8'))" />
-->
<xsl:value-of select= "concat($protocol,$baseurl,'/#',@id)" />
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 </xsl:text>
2019-06-12 23:48:42 +02:00
</xsl:if>
2021-04-08 10:22:00 +02:00
</xsl:element> <xsl:text > 	 </xsl:text>
2019-05-07 09:16:56 +02:00
</xsl:for-each>
2021-04-08 10:22:00 +02:00
</channel> <xsl:text > 	 </xsl:text> </rss>
2019-05-07 09:16:56 +02:00
</xsl:template>
</xsl:stylesheet>