Hacking atom.vm

Well my little hack of atom.vm to produce valid atom 1.0 output was buggy: I got caught out by the atom content element and the existing showEntryDescription($entry) macro (in weblog.vm). This escapes the content which is not at all the atom way. Instead you have to declare a HMTL namespace. A quick trip over to the source of Tim Bray's atom feed shows how to do it. So I replaced the entry content code with this:

<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
$entry.text
</div>
</content>

Now everthing validates in feedvalidator. Of course, all this messing around makes me a moron.

This sort of hacking is actually a really bad idea and pretty fragile, so bring on roller 1.3.




This entry was posted in Java. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *