I am working on an XSL to transform RSS/RDF feeds into HTML
I have come across a bunch of feeds that only have a <description> for each <item> but no <title>.
In this event I would like to use the <description> node as if it where the <title> node. I tried something like the following fragment, but it doesn't change anything. How can I obtain what I require while keeping one single universal XSLT? Thanks!
<xsl:template match="item">
<xsl:variable name="item_link" select="link"/>
<xsl:variable name="item_descr" select="description"/>
<xsl:variable name="item_title" select="title"/>
<li >
<a href="{$item_link}" target="_blank" >
<xsl:if test="$item_title=''">
<xsl:value-of select="description" />
</xsl:if>
<xsl:value-of select="title"/>
</a>
<br /><div style="display:none"><xsl:value-of select="description" disable-output-escaping="yes" /></div> </li> </xsl:template>
Alex.
I have come across a bunch of feeds that only have a <description> for each <item> but no <title>.
In this event I would like to use the <description> node as if it where the <title> node. I tried something like the following fragment, but it doesn't change anything. How can I obtain what I require while keeping one single universal XSLT? Thanks!
<xsl:template match="item">
<xsl:variable name="item_link" select="link"/>
<xsl:variable name="item_descr" select="description"/>
<xsl:variable name="item_title" select="title"/>
<li >
<a href="{$item_link}" target="_blank" >
<xsl:if test="$item_title=''">
<xsl:value-of select="description" />
</xsl:if>
<xsl:value-of select="title"/>
</a>
<br /><div style="display:none"><xsl:value-of select="description" disable-output-escaping="yes" /></div> </li> </xsl:template>
Alex.