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…
Wait a minute, so how do *I* use it?
> 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.
your comment system ate your code in the instructions
Thanks for the heads up, Jonathan. It’s fixed now.
Thank you very very much for the information and for stylesheet .
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
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.
Chris, that’s awesome. Thanks.