RSS feeds done right – XML + XSLT

by Anthony on October 27, 2006

This is a blog, and its got an RSS feed. It feels like RSS feeds are becoming more and more common every day. Part of this is due to the growing popularity of blogs, and partly because web users are becoming a little more savvy.

Once upon a time there was a web user. We’ll call her Betty. Betty found a blog she liked to read, and she checked back daily for new posts. Then Betty found out about some more blogs she liked, so she started checking those daily too. It wasn’t look before Betty was checking 30 blogs every day – and wow, it was starting to take a while!

This is where RSS feeds come in. RSS (Really Simple Syndication) is a way for a blog to make its content available in an easily transportable format. So Betty signed up to Google Reader (or any of a million other aggregators (RSS Readers), where she could read all 30 of her blogs in one place, without wasting time visiting all of these other sites. And she lived happily ever after.

RSS Icon
Its very common now to visit a blog and see a button linking to the RSS feed for that blog. But in most cases, when you click the icon, you saw raw code.

You see, RSS feeds are constructed from XML code. Its kind of ugly to the untrained eye! But have you ever heard of XLST? It is to XML what CSS is to HTML – only a little cooler. Take a look at the fergusweb RSS feed. Thats not unstyled content! (Its not all that pretty either, but hey – thats feedburner for you!)

Its got an info-box at the top showing ways to subscribe, and it lays out the raw data in an acceptable manner. This is done with the help of XLST. Because XLST doesn’t just dictate style rules but it also allows you to add other content in – content only visible to the web browser, not shown by the reader. Which is great for that “here’s an RSS feed, and here’s what you can do with it” message that should be at the top of an RSS feed.

You see, me – I find an RSS feed, I copy/paste the url into Google Reader. But someone who hasn’t experienced RSS before really needs an introductory note.

So, if you publish an RSS feed, visit it in your web-browser to see what your visitors will see. Does yours look as pretty as mine?

I’m going to be modifying some scripts I wrote for other projects to publish RSS feeds, and I’m going to be integrating XLST in there. Now, I’ve never done this before, so I have a bit of research/learning to do first. I’ll post again with a tutorial on the basics of XLST when I’ve done this.

Leave a Comment

Previous post:

Next post: