Pheed

Syndication Software, News, Ideas, and Images

Safari 1.3 and XSLT


The macintosh world has been buzzing about the latest update from Apple. It has caused some problems including, a now resolved issue, with our own Pheeder, but it also revealed a new version of Safari implementing some of the functionality from the latest webkit framework.

Dave Hyatt's blog will give you the complete details, but for now I want to point out one of the most exiting new features--client side XLST. We've been waiting a long time for this. XSLT is a transformation language that allows you to turn one XML document into different one. I know! Exciting, isn't it! Seriously though, XSLT allows you put data in one spot and the transform it however you see fit in many different ways. This promotes a healthy separation of data and presentation. You can have one document with your data and a thousand document describing a thousand ways to present it. If you need to change your data, it's a simple edit in one place. This is similar to what CSS allows you to do with HTML, but because XSL can transform the fundamental structure of the document it adds some impressive flexibility and power.

I've put together a little demonstration for Safari users (if you're not using Safari, I make no promises regarding how the following link will render) to show what their new browser can do with a simple RSS/Pheed document. The RSS document is here: http://www.pheed.com/examples/PheedXSL.xml. If you open it in Safari, it should look like a regular webpage, but if you look at the source you will see that it has no HTML--it is simply an RSS document. The HTML only exists after it is transformed by this document http://www.pheed.com/examples/pheed_preview.xsl

To join the two documents and make them work together you only need to include the line <?xml-stylesheet type="text/xml" href="pheed_preview.xsl"?> at the top of the RSS document. This is some really good stuff.

[ /PhotoPheed | permanent link ]