22 ms·
I strongly recommend adding a schema validator to anything that generates XML. ATOM¹ has a nice schema available² that you can use at the end to check the whole
by sedachv 5y ago
I strongly recommend adding a schema validator to anything that generates XML. ATOM¹ has a nice schema available² that you can use at the end to check the whole thing (I use xmllint³, since it is in a lot of package repositories). Another nice thing about ATOM compared to RSS is that it has the xml:base attribute, which means you do not need to rewrite relative URLs into absolute ones. You can use recode's⁴ XML-standalone/r0 charset to do the XML escaping correctly. And of course you should be using tidy⁵ to make sure the HTML is correct before putting it into the feed or publishing it on the web. It only takes about 6 lines of shell code using the mentioned tools to generate the ATOM feed for my blog.⁶
¹ https://www.rfc-editor.org/rfc/rfc4287.txt https://www.rfc-editor.org/rfc/rfc4287.txt
² https://gist.github.com/tjdett/4617547 https://gist.github.com/tjdett/4617547
³ http://xmlsoft.org/xmllint.html http://xmlsoft.org/xmllint.html
⁴ https://github.com/rrthomas/recode/ https://github.com/rrthomas/recode/
⁵ https://www.html-tidy.org/ https://www.html-tidy.org/
⁶ https://oneofus.la/have-emacs-will-hack/files/current/Makefile https://oneofus.la/have-emacs-will-hack/files/current/Makefi...