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:
parent
6c95011168
commit
255bd064c5
15
xsl/date.xsl
15
xsl/date.xsl
|
@ -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>
|
||||
|
|
21
xsl/rss.xsl
21
xsl/rss.xsl
|
@ -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">
|
||||
<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>><xsl:apply-templates mode="escaped"/></a>
|
||||
<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="resource" mode="escaped"/>
|
||||
|
|
Loading…
Reference in New Issue