RSS repariert:

- pubDate als RFC822
- Position von description
- escapete a in description immer absolut mit $baseurl


git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@489 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2006-07-28 02:10:46 +00:00
parent 6c95011168
commit 255bd064c5
2 changed files with 30 additions and 6 deletions

View File

@ -386,4 +386,19 @@
<xsl:value-of select="date:year($date)"/><xsl:value-of select="$month_in_year"/><xsl:value-of select="$day_in_month"/><xsl:if test="date:hour-in-day($date)">T<xsl:value-of select="$hour_in_day"/><xsl:value-of select="$minute_in_hour"/><xsl:value-of select="$second_in_minute"/></xsl:if>
</xsl:template>
<!-- Geklaut von:
http://www.trachtenberg.com/blog/2005/03/03/xslt-cookbook-generating-an-rfc-822-date/
TODO: Zeitzone stimmt sicher nicht...
-->
<xsl:template name="date-to-rfc822">
<xsl:param name="date"/>
<xsl:value-of select="concat(date:day-abbreviation($date), ', ',
format-number(date:day-in-month($date), '00'), ' ',
date:month-abbreviation($date), ' ', date:year($date), ' ',
format-number(date:hour-in-day($date), '00'), ':',
format-number(date:minute-in-hour($date), '00'), ':',
format-number(date:second-in-minute($date), '00'), ' GMT')"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -38,11 +38,15 @@
<xsl:param name="newsfile"/>
<item>
<title><xsl:value-of select="@title"/></title>
<link><xsl:value-of select="$baseurl"/><xsl:value-of select="substring-before(substring-after($newsfile, 'content/'), '.xml')"/>.html</link>
<description><xsl:apply-templates mode="escaped"/></description>
<link><xsl:value-of select="$baseurl"/><xsl:value-of select="substring-before(substring-after($newsfile, 'content/'), '.xml')"/>.html</link>
<author><xsl:value-of select="@author"/></author>
<category><xsl:value-of select="@category"/></category>
<pubDate><xsl:value-of select="@date"/></pubDate>
<pubDate>
<xsl:call-template name="date-to-rfc822">
<xsl:with-param name="date" select="@date"/>
</xsl:call-template>
</pubDate>
<!--
TODO:
Jemand mit iTunes (erhältlich für OSX und Windows)
@ -77,10 +81,15 @@
</xsl:template>
<xsl:template match="link" mode="escaped">
&lt;a <xsl:choose>
<xsl:when test="@href">href="<xsl:value-of select="@href"/>"</xsl:when>
<xsl:otherwise>href="<xsl:value-of select="."/>"</xsl:otherwise>
</xsl:choose>&gt;<xsl:apply-templates mode="escaped"/>&lt;/a&gt;
<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>
&lt;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>"&gt;<xsl:apply-templates mode="escaped"/>&lt;/a&gt;
</xsl:template>
<xsl:template match="resource" mode="escaped"/>