podcast feed: fix & enhance item titles (in case of multiple items per news)

This commit is contained in:
Astro 2011-11-14 02:45:05 +01:00
parent 79d7a2f842
commit 63821c5402
1 changed files with 15 additions and 23 deletions

View File

@ -156,7 +156,7 @@
</xsl:choose>
</xsl:template>
<xsl:template match="resource">
<xsl:template match="*[name() = 'resource' or name() = 'alternative']">
<xsl:param name="newsfile"/>
<xsl:variable name="href">
@ -167,28 +167,20 @@
<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="date" select="document($newsfile)/item/@date"/>
<xsl:with-param name="resource_url" select="$href"/>
<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"/>
<xsl:variable name="href">
<xsl:call-template name="make-href">
<xsl:with-param name="href" select="@url"/>
</xsl:call-template>
</xsl:variable>
<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="item_title">
<xsl:value-of select="document($newsfile)/item/@title"/>
<xsl:if test="count(document($newsfile)//resource) &gt; 1 and @title">
<!-- Multiple resources in this item? -->
<xsl:text>: </xsl:text>
<xsl:value-of select="@title"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="resource_title">
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="date" select="document($newsfile)/item/@date"/>
<xsl:with-param name="resource_url" select="$href"/>
<xsl:with-param name="resource_size" select="@size"/>