我正在为 RSS 提要设置样式,但以下部分存在问题:
<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>
你可以在这里看到我的尝试
这是我的 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>
我正在尝试从描述标签中获取信息,这样我就可以像设置标题和发布日期一样设置它的样式。这是我尝试设置样式的完整 XML RSS 提要。谁能帮我弄清楚为什么 CDATA 标签把事情搞砸了?