2007-04-10 05:06:51 +02:00
<?xml version="1.0" encoding="utf-8"?>
<!-- Spezifikation:
http://www.apple.com/itunes/store/podcaststechspecs.html
-->
<xsl:stylesheet version= "1.0"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
2011-07-12 02:08:24 +02:00
xmlns:content="http://purl.org/rss/1.0/modules/content/"
2007-04-10 05:06:51 +02:00
exclude-result-prefixes="xsl date">
<xsl:output method= "xml"
version="1.0"
encoding="utf-8"
indent="yes"/>
2007-10-27 16:16:39 +02:00
<xsl:include href= "common.xsl" />
2007-04-10 05:06:51 +02:00
2007-04-19 14:32:58 +02:00
<xsl:variable name= "baseurl" > http://www.c3d2.de/</xsl:variable>
2009-10-25 13:45:19 +01:00
<xsl:param name= "selection" select= "''" />
2007-04-10 05:06:51 +02:00
<xsl:template match= "news" >
<rss version= "2.0" >
2009-10-25 13:45:19 +01:00
<xsl:message > selection: '<xsl:value-of select= "$selection" /> '</xsl:message>
2007-04-10 05:06:51 +02:00
<channel >
2009-10-25 13:45:19 +01:00
<xsl:choose >
2011-01-09 23:58:22 +01:00
<xsl:when test= "$selection = 'pentaradio' or $selection = 'pentamedia'" >
2009-10-25 13:45:19 +01:00
<title > Pentaradio</title>
<link > <xsl:value-of select= "$baseurl" /> radio.html</link>
<description > C3D2 Pentaradio</description>
<language > de</language>
<copyright > http://creativecommons.org/licenses/by-sa/2.0/de/</copyright>
<itunes:subtitle > Radio vom CCC Dresden</itunes:subtitle>
<itunes:summary >
Pentaradio sind die Sendungen des Chaos Computer Club Dresden auf coloRadio, bestehend aus einem informativen Rahmenprogramm und Beiträgen zu einem sendungsspezifischen Thema.
</itunes:summary>
<itunes:image href= "{$baseurl}images/pentaradio.png" />
2010-01-16 01:50:20 +01:00
<itunes:category text= "Society & culture" />
<itunes:category text= "Talk" >
<itunes:category text= "Radio" />
</itunes:category>
<itunes:category text= "Technology" />
2009-10-25 13:45:19 +01:00
</xsl:when>
2011-01-09 23:58:22 +01:00
<xsl:when test= "$selection = 'pentacast' or $selection = 'pentamedia'" >
2009-10-25 13:45:19 +01:00
<title > Pentacast</title>
<link > <xsl:value-of select= "$baseurl" /> podcast.html</link>
<description > C3D2 Pentacast</description>
<language > de</language>
<copyright > http://creativecommons.org/licenses/by-sa/2.0/de/</copyright>
<itunes:subtitle > Podcasts vom CCC Dresden</itunes:subtitle>
<itunes:summary >
Pentacast sind themenspezifische Sendungen des Chaos
Computer Club Dresden.
</itunes:summary>
<itunes:image href= "{$baseurl}images/pentacast.png" />
2010-01-16 01:50:20 +01:00
<itunes:category text= "Society & culture" />
<itunes:category text= "Talk" >
<itunes:category text= "Radio" />
</itunes:category>
<itunes:category text= "Technology" />
</xsl:when>
2011-01-09 23:58:22 +01:00
<xsl:when test= "$selection = 'pentamusic' or $selection = 'pentamedia'" >
2010-01-16 01:50:20 +01:00
<title > Pentamusic</title>
<link > <xsl:value-of select= "$baseurl" /> pentamusic.html</link>
<description > C3D2 Pentamusic</description>
<language > de</language>
<copyright > http://creativecommons.org/licenses/by-sa/2.0/de/</copyright>
<itunes:subtitle > Musikvorstellungen vom CCC Dresden</itunes:subtitle>
<itunes:summary >
Versuch, Künstler, Bands und Labels der CC-Szene vors
Mikro zu holen um diese einer breiteren Öffentlichkeit
bekannt zu machen.
</itunes:summary>
<itunes:image href= "{$baseurl}images/pentacast.png" />
<itunes:category text= "Music" />
2009-10-25 13:45:19 +01:00
</xsl:when>
<xsl:otherwise >
<title > C3D2 Podcast</title>
<link > <xsl:value-of select= "$baseurl" /> </link>
<description > C3D2 Podcast</description>
<language > de</language>
<copyright > http://creativecommons.org/licenses/by-sa/2.0/de/</copyright>
<itunes:subtitle > Radio & Podcasts vom CCC Dresden</itunes:subtitle>
<itunes:summary >
Pentaradio & Pentacast vom Chaos Computer Club Dresden.
</itunes:summary>
<itunes:image href= "{$baseurl}images/pentaradio.png" />
2010-01-16 01:50:20 +01:00
<itunes:category text= "Society & culture" />
<itunes:category text= "Talk" >
<itunes:category text= "Radio" />
</itunes:category>
<itunes:category text= "Technology" />
2009-10-25 13:45:19 +01:00
</xsl:otherwise>
</xsl:choose>
2007-04-19 14:32:58 +02:00
<itunes:author > Chaos Computer Club Dresden</itunes:author>
2010-01-27 13:39:47 +01:00
<itunes:owner >
<itunes:name > C3D2</itunes:name>
<itunes:email > mail@c3d2.de</itunes:email>
</itunes:owner>
2007-04-10 05:06:51 +02:00
<xsl:for-each select= "newsfile" >
<xsl:sort select= "date:seconds(document(.)/item/@date)" data-type= "number" order= "descending" />
2009-10-25 13:45:19 +01:00
<xsl:choose >
2011-01-10 00:09:25 +01:00
<xsl:when test= "($selection = ' p e n t a r a d i o ' o r $ selection = 'pentamedia' ) a n d
starts-with(., 'content/news/pentaradio') and
2009-10-25 13:45:19 +01:00
count(document(.)/item/resource) > 0">
2011-01-10 00:09:25 +01:00
<xsl:apply-templates select= "document(.)/item/resource" mode= "preselect" >
<xsl:with-param name= "newsfile" select= "." />
</xsl:apply-templates>
2009-10-25 13:45:19 +01:00
</xsl:when>
2011-01-10 00:09:25 +01:00
<xsl:when test= "($selection = ' p e n t a c a s t ' o r $ selection = 'pentamedia' ) a n d
starts-with(., 'content/news/pentacast') and
2009-10-25 13:45:19 +01:00
count(document(.)/item/resource) > 0">
2011-01-10 00:09:25 +01:00
<xsl:apply-templates select= "document(.)/item/resource" mode= "preselect" >
<xsl:with-param name= "newsfile" select= "." />
</xsl:apply-templates>
2009-10-25 13:45:19 +01:00
</xsl:when>
2011-01-10 00:09:25 +01:00
<xsl:when test= "($selection = ' p e n t a m u s i c ' o r $ selection = 'pentamedia' ) a n d
starts-with(., 'content/news/pentamusic') and
2010-01-16 01:50:20 +01:00
count(document(.)/item/resource) > 0">
2011-01-10 00:09:25 +01:00
<xsl:apply-templates select= "document(.)/item/resource" mode= "preselect" >
<xsl:with-param name= "newsfile" select= "." />
</xsl:apply-templates>
</xsl:when>
<xsl:when test= "$selection = '' and count(document(.)/item/resource) > 0" >
<xsl:apply-templates select= "document(.)/item/resource" mode= "preselect" >
<xsl:with-param name= "newsfile" select= "." />
</xsl:apply-templates>
2010-01-16 01:50:20 +01:00
</xsl:when>
2009-10-25 13:45:19 +01:00
</xsl:choose>
2007-04-10 05:06:51 +02:00
</xsl:for-each>
</channel>
</rss>
</xsl:template>
2007-04-17 15:37:14 +02:00
<!-- Preselect heißt:
* Gucken, ob es in der Resource nicht ein Alternative gibt, welches MP3 ist
* Dann dieses nehmen
* Ansonsten die Resource nehmen
-->
<xsl:template match= "resource" mode= "preselect" >
<xsl:param name= "newsfile" />
<xsl:choose >
2011-07-12 02:08:24 +02:00
<!-- Gibts ein MP3? -->
2007-04-17 15:37:14 +02:00
<xsl:when test= "count(alternative[@type='audio/mpeg']) > 0" >
<xsl:apply-templates test= "alternative[@type='audio/mpeg'][1]" >
<xsl:with-param name= "newsfile" select= "$newsfile" />
</xsl:apply-templates>
</xsl:when>
2011-07-12 02:08:24 +02:00
<!-- Nimm was da ist (OGG) -->
2007-04-17 15:37:14 +02:00
<xsl:otherwise >
<xsl:apply-templates select= "." >
<xsl:with-param name= "newsfile" select= "$newsfile" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match= "resource" >
<xsl:param name= "newsfile" />
2007-10-27 16:16:39 +02:00
<xsl:variable name= "href" >
<xsl:call-template name= "make-href" >
<xsl:with-param name= "href" select= "@url" />
</xsl:call-template>
</xsl:variable>
2007-04-17 15:37:14 +02:00
<xsl:call-template name= "generate-item" >
<xsl:with-param name= "newsfile" select= "$newsfile" />
<xsl:with-param name= "item_title" select= "../@title" />
<xsl:with-param name= "resource_title" select= "@title" />
<xsl:with-param name= "author" select= "../@author" />
<xsl:with-param name= "date" select= "../@date" />
2007-10-27 16:16:39 +02:00
<xsl:with-param name= "resource_url" select= "$href" />
2007-04-17 15:37:14 +02:00
<xsl:with-param name= "resource_size" select= "@size" />
<xsl:with-param name= "resource_type" select= "@type" />
</xsl:call-template>
</xsl:template>
<xsl:template match= "alternative" >
<xsl:param name= "newsfile" />
2007-10-27 16:16:39 +02:00
<xsl:variable name= "href" >
<xsl:call-template name= "make-href" >
<xsl:with-param name= "href" select= "@url" />
</xsl:call-template>
</xsl:variable>
2007-04-17 15:37:14 +02:00
<xsl:call-template name= "generate-item" >
<xsl:with-param name= "newsfile" select= "$newsfile" />
<xsl:with-param name= "item_title" select= "../../@title" />
<xsl:with-param name= "resource_title" select= "../@title" />
<xsl:with-param name= "author" select= "../../@author" />
<xsl:with-param name= "date" select= "../../@date" />
2007-10-27 16:16:39 +02:00
<xsl:with-param name= "resource_url" select= "$href" />
2007-04-17 15:37:14 +02:00
<xsl:with-param name= "resource_size" select= "@size" />
<xsl:with-param name= "resource_type" select= "@type" />
</xsl:call-template>
</xsl:template>
<xsl:template name= "generate-item" >
2007-04-10 05:06:51 +02:00
<xsl:param name= "newsfile" />
2007-04-17 15:37:14 +02:00
<xsl:param name= "item_title" />
<xsl:param name= "resource_title" />
<xsl:param name= "author" />
<xsl:param name= "date" />
<xsl:param name= "resource_url" />
<xsl:param name= "resource_size" />
<xsl:param name= "resource_type" />
2007-04-10 05:06:51 +02:00
<item >
<xsl:variable name= "href" >
<xsl:value-of select= "$baseurl" />
<xsl:value-of select= "substring-before(substring-after($newsfile, 'content/'), '.xml')" />
<xsl:text > .html</xsl:text>
</xsl:variable>
2007-12-02 18:31:41 +01:00
<title > <xsl:value-of select= "$item_title" /> </title>
2007-04-10 05:06:51 +02:00
<link > <xsl:value-of select= "$href" /> </link>
2007-04-17 15:37:14 +02:00
<enclosure
2007-04-18 01:11:20 +02:00
url="{$resource_url}"
2007-04-17 15:37:14 +02:00
length="{$resource_size}"
type="{$resource_type}"
/>
2007-04-19 14:32:58 +02:00
<guid isPermaLink= "false" > <xsl:value-of select= "concat($href, '+++', $resource_url)" /> </guid>
2007-04-10 05:06:51 +02:00
<pubDate >
<xsl:call-template name= "date-to-rfc822" >
2007-04-17 15:37:14 +02:00
<xsl:with-param name= "date" select= "$date" />
2007-04-10 05:06:51 +02:00
</xsl:call-template>
</pubDate>
2011-07-12 02:08:24 +02:00
<description >
<xsl:value-of select= "string(document($newsfile))" />
</description>
<content:encoded >
<xsl:text disable-output-escaping= "yes" > < ![CDATA[</xsl:text>
<div xmlns= "http://www.w3.org/1999/xhtml" >
<xsl:apply-templates select= "document($newsfile)/item" />
</div>
<xsl:text disable-output-escaping= "yes" > ]]> </xsl:text>
</content:encoded>
2007-04-17 15:37:14 +02:00
<!-- iTunes - Extensions zum Schluss, sonst validiert es nicht -->
2007-04-10 05:06:51 +02:00
2007-12-02 18:31:41 +01:00
<itunes:subtitle > <xsl:value-of select= "$resource_title" /> </itunes:subtitle>
<itunes:author > CCC Dresden</itunes:author>
2007-04-10 05:06:51 +02:00
2007-04-17 15:37:14 +02:00
</item>
2007-04-10 05:06:51 +02:00
</xsl:template>
</xsl:stylesheet>