Transforming FeedDemon

This post by Les Orchard prompted me to think about how I’m increasingly relying on XSL transformations for much of FeedDemon’s UI. For example, every FeedDemon newspaper relies on transforming RSS, and the new subscription overview in FeedDemon 2.0 is generated by transforming the OPML file containing your subscriptions. For a live demo of this, take a look at these three files:

  • subscriptions.xml – this is the “raw” OPML file (not transformed)
  • subscriptions.xsl – this is the XSL file used to transform the OPML
  • subscriptions-t.xml – this is the same OPML file with the XSL applied to it (note that hyperlinks will fail since they use an fdaction protocol that only works inside FeedDemon.)

I hadn’t worked with XSL prior to creating FeedDemon, so the newspapers in the very first version of FeedDemon were sort of ugly, and they took ages for me to create. After all, I was used to object-oriented programming, not the strange world of XSLT. Learning XSLT wasn’t a whole lot of fun, either. It’s an odd language with unexpected omissions, bizarre rules and a learning curve that’s made steeper by unexpected “gotchas” – in other words, it’s just like every other language out there.

I still feel like a beginner with XSL, but I grok its power now that I’ve used it for a while. The ability to create a friendly, web-like user interface by transforming XML documents is definitely handy, and in some ways I find it simpler than “traditional” GUI development since I can make huge design changes with a few lines of XSL without having to re-arrange a dialog full of widgets.

14 thoughts on “Transforming FeedDemon

  1. Welcome to this world! A couple of years ago I wrote a half-assed application to create small websites. It was very similar in concept to FogCreek’s CityDesk, but I wrote it a couple of months before. Anyways, it uses XSLT; my homepage (in spanish, sorry) uses it to magically generate a calendar. I even wrote a how-to (in spanish again, sorry):
    Ouch, this was back in 2002. Heh. Obviously, my app went the way of the dodo, but I still use it to update my weblog. I wrote it in Delphi, by the way :-)

  2. Nick, it was from hacking at the Newspaper XSL transformations in FeedDemon that I was introduced to XSLT. I’ve learned a lot just by looking at your XSL stylesheets.

  3. Anne: Modesty compels me to point out that that use of XSLT with OPML wasn’t created by me. :)
    Nick: You know, FeedDemon is one of the few apps that makes me sometimes wish I used Windows more often.

  4. Nick Bradbury on XSLT

    Nick Bradbury puts it well: Learning XSLT wasn’t a whole lot of fun, either. It’s an odd language with unexpected…

  5. This is a topic that I’m just starting to investigate, and I have a beginner’s question.
    What is the actual process of invoking an xslt to say an opml file? Do you link to the xsl from within the opml file?
    I’ve found some sample transform stylesheets, and have an opml file…but am missing the ‘connection’ point…thanks

  6. Dan: that’s great that FeedDemon’s newspapers helped you learn XSL!
    Brian: O’Reilly’s “Learning XSLT” is probably a good book to start with. I recommend coming up with a non-trivial task you want to perform with XSL and then simply doing it. Even if it’s hard and takes a while, you’ll learn a lot in the process.
    Mark: Do a “view source” on the subscriptions-t.xml file linked above – you’ll see that it contains an ?xml-stylehseet instruction near the top which links the XSL.

  7. The latest version of Dreamweaver does non-complex XML transformations. Good enough for many RSS and OPML. There is a steep price to get Dreamweaver, but if you own it, you can learn XSLT that way.

  8. Nick:
    The nice thing about XSLT is that it is easier for us as users to customize our experience by adjusting the code as desired to apply our own favorite color schemes, etc…
    No complaints here!

  9. I’m trying to get this to work…and I just clipped out the part of Nick’s file that referenced the transform, and changed the url…but I get the following error:
    Invalid syntax for an xml declaration. Error processing resource ''. Line 2, Position 1

Comments are closed.