« magazines | Main | the very model »

opml2html

I buckled down and wrote a piece of XSLT that transforms OPML to HTML for use in a movable type template. Now, there are some things that I had to do out of conforming to my specific need. For example, where normally you would have an element tag for the a element, I was unable to do this because the tag does not close out right at the end. So for those of you learning XSLT, this is not the recommended way to do things. Also, I have only tested this for radio userland exports. If I have time later, I will test this out from newsgator exports.

On the off chance that you are migrating a radio userland opml to populate your links list from within the movable type "main" template, here is how you should use this code:

1) Copy this code and paste into a text file called transformer.xsl
2) Rename your radio userland output to transform_me.xml from whatever.opml
3) Add the following lines at the top of transform_me.xml:

Download doc

4) Right click on transform_me.xml and select Open With... IE
5) Now you can copy from the text displayed in your browser into the relevant section within your mt template.

Here's the code for transformer.xsl:

Download doc

Lastly, I should mention that everything is in doc format due to the vagaries of html and xml interpretation if I linked to it directly. I have virus protection, so don't wory, I just want this to work for you. Please leave a comment or contact me with any issues.

Comments

Hi Elizabeth

I'd like to try this out, not least because I'd like to learn more about XSLT transforms. Unfortunately the link to you doc files throws up a 'currently unavailable for viewing' error. Any ideas?

Cheers,

David.

Whoops - you have to right-click on the links and then select "Save Target As"