Quantcast
Channel: Styling RSS feed using XSLT, issues with CDATA tags - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Styling RSS feed using XSLT, issues with CDATA tags

$
0
0

I am styling an RSS feed but having an issue with the following part:

<description><![CDATA[<img src="http://l.yimg.com/a/i/us/we/52/34.gif"/><br /> <b>Current Conditions:</b><br /> Fair, 73 F<BR /> <BR /><b>Forecast:</b><BR /> Sat - Clear. High: 78 Low: 62<br /> Sun - Mostly Sunny. High: 80 Low: 66<br /> <br /> <a href="http://us.rd.yahoo.com/dailynews/rss/weather/Dubai__AE/*http://weather.yahoo.com/forecast/AEXX0004_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/> (provided by <a href="http://www.weather.com">The Weather Channel</a>)<br/>]]></description>

You can see my attempt here

Here is my XSLT:

<?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><html><head><title></title></head><body><table cellpadding="2" cellspacing="0" border="0" width="75%"><xsl:for-each select="rss/channel/item"><tr style="color:#0080FF;"><td style="text-align:left;font-weight:bold;"><xsl:value-of select ="title"></xsl:value-of></td></tr><tr style="color:#0080FF;"><td style="text-align:left;font-weight:bold;"><xsl:value-of select ="location"></xsl:value-of><xsl:value-of select="pubDate"/></td></tr><tr><td colspan="2" style="text-align:left;padding-top:10px;"><xsl:value-of select="description"/></td></tr><tr><td colspan="2" style="height:20px;"><hr></hr></td></tr></xsl:for-each></table></body></html></xsl:template></xsl:stylesheet>

I am trying to get the information from the description tag so I can style it like I did the title and publication date. Here is the full XML RSS feed which I am trying to style. Can anyone help me figure out why the CDATA tags are messing things up?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images