rss & podcast-feeds w/ <description/> & <content:encoded/>
This commit is contained in:
parent
49312d0701
commit
e633a97350
|
@ -8,6 +8,7 @@
|
|||
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"
|
||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
||||
exclude-result-prefixes="xsl date">
|
||||
|
||||
<xsl:output method="xml"
|
||||
|
@ -145,11 +146,13 @@
|
|||
<xsl:param name="newsfile"/>
|
||||
|
||||
<xsl:choose>
|
||||
<!-- Gibts ein MP3? -->
|
||||
<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>
|
||||
<!-- Nimm was da ist (OGG) -->
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="newsfile" select="$newsfile"/>
|
||||
|
@ -234,6 +237,17 @@
|
|||
</xsl:call-template>
|
||||
</pubDate>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- iTunes-Extensions zum Schluss, sonst validiert es nicht -->
|
||||
|
||||
<itunes:subtitle><xsl:value-of select="$resource_title"/></itunes:subtitle>
|
||||
|
|
104
xsl/rss.xsl
104
xsl/rss.xsl
|
@ -2,6 +2,7 @@
|
|||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:date="http://exslt.org/dates-and-times"
|
||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
||||
exclude-result-prefixes="xsl date">
|
||||
|
||||
<xsl:include href="common.xsl" />
|
||||
|
@ -51,7 +52,17 @@
|
|||
</xsl:variable>
|
||||
|
||||
<title><xsl:value-of select="@title"/></title>
|
||||
<description><xsl:apply-templates mode="escaped"/></description>
|
||||
<description>
|
||||
<xsl:value-of select="string(.)"/>
|
||||
</description>
|
||||
<content:encoded>
|
||||
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
|
||||
<div xmlns="http://www.w3.org/1999/xhtml">
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
<xsl:text disable-output-escaping="yes">]]></xsl:text>
|
||||
</content:encoded>
|
||||
|
||||
<link><xsl:value-of select="$href"/></link>
|
||||
<author><xsl:value-of select="@author"/></author>
|
||||
|
||||
|
@ -94,95 +105,4 @@
|
|||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="pre" mode="escaped">
|
||||
<pre><xsl:apply-templates mode="escaped"/></pre>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p" mode="escaped">
|
||||
<p><xsl:apply-templates mode="escaped"/></p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="image" mode="escaped">
|
||||
<xsl:variable name="url"><xsl:choose>
|
||||
<xsl:when test="contains(., '://')"><xsl:value-of select="."/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="concat($baseurl, 'images/news/', .)"/></xsl:otherwise>
|
||||
</xsl:choose></xsl:variable>
|
||||
|
||||
<img src="<xsl:value-of select="$url"/>"<xsl:if test="@title"> title="<xsl:value-of select="@title"/>" alt="<xsl:value-of select="@title"/>"</xsl:if><xsl:if test="@class"> class="<xsl:value-of select="@class"/>"</xsl:if>/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="link" mode="escaped">
|
||||
<xsl:variable name="href"><xsl:choose>
|
||||
<xsl:when test="@href"><xsl:value-of select="@href"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
||||
</xsl:choose></xsl:variable>
|
||||
|
||||
<a href="<xsl:choose>
|
||||
<xsl:when test="contains($href, ':')"><xsl:value-of select="$href"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="concat($baseurl, $href)"/></xsl:otherwise>
|
||||
</xsl:choose>"><xsl:apply-templates mode="escaped"/></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dl" mode="escaped">
|
||||
<dl><xsl:apply-templates mode="escaped"/></dl>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dh" mode="escaped">
|
||||
<dt><xsl:apply-templates mode="escaped"/></dt>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dt" mode="escaped">
|
||||
<dt><xsl:apply-templates mode="escaped"/></dt>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dd" mode="escaped">
|
||||
<dd><xsl:apply-templates mode="escaped"/></dd>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul" mode="escaped">
|
||||
<ul><xsl:apply-templates mode="escaped"/></ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol" mode="escaped">
|
||||
<ol><xsl:apply-templates mode="escaped"/></ol>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="li" mode="escaped">
|
||||
<li><xsl:apply-templates mode="escaped"/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="resource" mode="escaped"/>
|
||||
|
||||
<!-- Support für <event/> -->
|
||||
<xsl:template match="item/event/start" mode="escaped">
|
||||
<dl>
|
||||
<dt>
|
||||
<xsl:choose>
|
||||
<xsl:when test="../end">Beginn</xsl:when>
|
||||
<xsl:otherwise>Datum</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</dt>
|
||||
<dd>
|
||||
<xsl:call-template name="get-datestring">
|
||||
<xsl:with-param name="date" select="."/>
|
||||
</xsl:call-template>
|
||||
</dd>
|
||||
</dl>
|
||||
</xsl:template>
|
||||
<xsl:template match="item/event/end" mode="escaped">
|
||||
<dl>
|
||||
<dt>Ende</dt>
|
||||
<dd>
|
||||
<xsl:call-template name="get-datestring">
|
||||
<xsl:with-param name="date" select="."/>
|
||||
</xsl:call-template>
|
||||
</dd>
|
||||
</dl>
|
||||
</xsl:template>
|
||||
<xsl:template match="item/event/location" mode="escaped">
|
||||
<dl>
|
||||
<dt>Ort</dt>
|
||||
<dd><xsl:apply-templates mode="escaped"/></dd>
|
||||
</dl>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in New Issue