I'm creating an RSS (and/or Atom) feed for my website. Now, I can immediately think of two ways to do this:
- Use the same templating system I use to generate the HTML (Clearsilver if anyone's wondering), basically just treating the RSS feed like any other web page that happens to be in RSS+XML instead of XHTML
- Use an XML library, or an RSS library specifically, in my programming language of choice (Python) to create the feed programmatically and then write it out
Are there particular reasons to choose one approach over the other? From initial impressions, I'm leaning toward option 1, mostly because it's easier to understand.
EDIT: so I got one good answer from Bill. But in this particular case all the values for the fields of the RSS feed are already formatted as well-formed, properly escaped XHTML... any other opinions?