views:

136

answers:

7

Is there any way on earth that I could pump some HTML through an RSS feed? I realize I'm bending the laws of science and all, but I'm under some tight circumstances. I have Wordpress set up so I'm posting a bit of HTML/Inline CSS in one end, and on another site, another web team is going to parse the RSS.

Is there any possible way to do this? Am I crazy? If not, is there another solution?

A: 

I think the HTML syntax will confuse the XML parser in a major way. The feed you would publish wouldn't be in any way valid RSS, or even proper XML, though.

You could encode the HTML stuff as character entities (< becomes &lt; and > &gt;) and let the web team decode them when parsing, but it might be a bit to much.

mensch
A: 

Encode the html and you won't have any problems.

pcp
+2  A: 

Use CDATA in your XML

Andrew G. Johnson
+4  A: 

HTML embedded in RSS should be entity encoded. As far as RSS is concerned, it's just text. The client application needs to know it contains HTML and render it properly.

http://tech.groups.yahoo.com/group/rss-public/message/24?threaded=1

Sam
+1  A: 

I guess it's possible from this link: http://www.intertwingly.net/blog/1299.html. Sounds like glibberish to me, but they seem to succeed in it. Something about . I don't get it.

Update: The W3C says:

An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed),

And this works for me:

<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Liftoff News</title>
      <link>http://liftoff.msfc.nasa.gov/&lt;/link&gt;
      <description>Liftoff to Space Exploration.</description>
      <language>en-us</language>
      <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
      <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
      <docs>http://blogs.law.harvard.edu/tech/rss&lt;/docs&gt;
      <generator>Weblog Editor 2.0</generator>
      <managingEditor>[email protected]</managingEditor>
      <webMaster>[email protected]</webMaster>
      <item>
         <description>Sky watchers in <strong><big>Europe</big></strong>, Asia, and parts of Alaska and Canada will experience a &lt;a href="http://science.nasa.gov/headlines/y2003/30may_solareclipse.htm"&amp;gt;partial eclipse of the Sun&lt;/a&gt; on Saturday, May 31st.</description>
         <pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate>
         <guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572&lt;/guid&gt;
      </item>
   </channel>
</rss>

Note the strong and big elements in the description. It's displayed properly in Safari.

nes1983
A: 

You should not need HTML if you use XSL to format the page.

Paul Creasey
A: 

there is http://feedoor.com to manage your feed and where you can style your feed and add custom CSS

3GFalcon