Kickin’ It, OPML Style

As much as I love XML files and the way that browsers display them with their little plus and minus toggles, a file is no good to me unless I can read and utilize the data it contains. So while OPML is great for storing link and feed data, I can’t really navigate an OPML file the same way I could a browser-generated quasi-HTML bookmarks file.

Thinking that someone else had to have run up against this problem by now, I was somewhat surprised when I couldn’t find any easily-accessible XSLT for transforming OPML to HTML; there was one page that everyone was linking to, but it is apparently MIA. There was also a page that dealt with creating an HTML blogroll from an OPML file, but I wanted something that would handle nested folders, HTML links, and RSS feeds.

So keeping that in mind, I present for your approval a stylesheet for transforming OPML files into cleanly presented lists of links and feeds (in HTML). My bookmarks are an example of a transformed file; the only change needed was to add the reference to the stylesheet at the top of the OPML file. So check it out, but don’t pay any attention to the folders full of Care Bears links. Those are for some, uh, research I’m doing…


Posted

in

, ,

by

Tags:

Comments

8 responses to “Kickin’ It, OPML Style”

  1. Sarit Avatar

    Wait a minute, so how do *I* use it?

  2. Christopher Finke Avatar

    > so how do *I* use it?

    Download this file: http://efinke.com/style/opml.xsl and save it in the same folder as your OPML file.

    At the top of your OPML file, insert

    <?xml-stylesheet type=”text/xsl” href=”opml.xsl”?>

    directly before the <opml version=”1.0″> part. That’s it. Your OPML
    file should now use the XSL stylesheet.

  3. jonathan peterson Avatar

    your comment system ate your code in the instructions

  4. Christopher Finke Avatar

    Thanks for the heads up, Jonathan. It’s fixed now.

  5. Ahmed Avatar
    Ahmed

    Thank you very very much for the information and for stylesheet .

  6. venkatramanan Avatar
    venkatramanan

    Chris

    Thanks for the tool.
    I followed your instructions with the OPML imported from Google reader. It almost worked. wait. Here’s the error I found. All my subscriptions were shown in the following format:

    Name of the blog
    http://feeds.feedburner.com/ChangethisNewsletter – But here’s the issue – The link for the URL is http://www.chrisfinke.com/files/%7B@xmlUrl%7D which takes me to http://www.chrisfinke.com/

    Kindly fix this issue. I have sent my OPML to you by mail.

    Regards
    Venkatramanan

  7. Andrew Kember Avatar

    Hi Chris, that’s awesome. I was just thinking about writing a program in Python to parse the OPML into html, but the nagging sensation that XSL was the Right (and obvious) tool made me google a bit harder, and led me to your stylesheet. Fantastic.

    By the way, if anybody has the problem that Venkatramanan has, above, where all links are to chrisfinke.com, the solution is to copy the stylesheet locally, and refer to it as the instructions (comment #2) indicate, not as http://chrisfinke.com/style/opml.xsl. I suspect that will solve your problem.

  8. GregC Avatar
    GregC

    Chris, that’s awesome. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

Google+