Applying XSLT To My Data Feeds

I’ve been playing with XSLT the past few days. XSLT is a really powerful technology for transforming XML data into other formats.

I’ve taken my RSS 0.91, 1.0 and 2.0 feeds and added a XSL stylesheet to them to produce HTML in the style of my website.

Now when you follow the feed links in the sidebar of the site, instead of getting raw XML (or RDF) you should get a basic HTML page that can be read in your browser.

It was easy to add in the stylesheet, it just needed a simple stylesheet declaration in the XML using the <?xml-stylesheet?> tag. Here’s the tag I used…

<?xml-stylesheet href="http://www.robertprice.co.uk/robblog/xsl/RSS.xsl" type="text/xsl" media="screen"?>

I’ve not got round to changing the atom feed just yet, but I’ll try to do that when I get a minute.

To see the stylesheet in action (assuming your browser can handle client side XSLT, which most can) use one of the following links…

Leave a Reply