RSS Reader in 10 lines of code

Marcus Denker denker at iam.unibe.ch
Tue Oct 4 10:01:21 UTC 2005


Am 04.10.2005 um 11:45 schrieb Tony Garnock-Jones:

> Bert Freudenberg wrote:
>
>> If you have Yaxo installed, try this:
>>
>
> Yikes! The RSS feed generated isn't well-formed XML!
>
> Here's a problem snippet:
>
> <item>
> <title>Morphic-stephaneducasse.51.mcz</title>
> <link>http://source.squeakfoundation.org/39a/Morphic- 
> stephaneducasse.51.mcz</link>
> <description>WorldState-UIMessages-fix-sk<br />Date:            23  
> January 2003<br />Author:            sk <steve at k-hornz.de>
> <br />            <br />0001552: [FIX]  
> WorldState>>runStepMethodsIn:</description>
> <pubDate>2 October 2005 4:26:30 pm</pubDate>
> <author>ducasse</author>
> <category>Squeak 3.9 alpha</category>
> </item>
>

It's even worse: Inside the <description> there can not be any HTML,  
as RSS is not a superset of HTML.
RSS readers are very forgiving (nobody checks the DTD, and they even  
tolerate non-well formed XML in
many cases).

But in general, to make this really work, the HTML inside the RSS  
needs to be encoded as CDATA:

<description>
<![CDATA[

now the html

]]>

    Marcus



More information about the Squeak-dev mailing list