I recently wrote an xml parser that follows the 1.0 xml spec to replace the quick and dirty parser I use in a feed reader. While testing it I got an error with the handmade network showcase feed. If you open the feed in your browser it should show the error, which is that the entry > content
element contains a non closed element.
This is caused by a <br>
element in the content element which isn't valid in xml (empty element in xml need to either have a /
before the >
or to have a close tag).
For reference here is a link to some of the relevant part of the atom spec.
I believe the best way to solve this issue, would be to change the type attribute in the content tag to be html
instead of xhtml
and to escape <
and &
in the element body or use a cdata section to avoid escaping. The handmade network post feed already uses html for content type.
<content type="html"> <![CDATA[ anything in here, even malformed html ]]> </content>
An alternative would be to add a cdata section after (I believe before wouldn't be valid according to the atom spec) the div in the content element.
<content type="xhtml"> <div><![CDATA[ anything in here, even malformed xhtml ]]></div> </content>
In my opinion (which is biased toward me making my feed reader) the xhtml type isn't useful (particularly without the cdata section) because it causes the xml parser to parse the xhtml (text -> xml tree), and if I want to pass the complete xhtml content to my program I need to reconstruct it (xml tree -> text) while the intermediate xml nodes where never used.
For example the dion.systems atom feed is well formed, but since it uses xhtml I need to reconstruct the text to display it.