Don't Back Down

Posted by Chad Everett on June 3, 2004

MT-Outliner 2.0.0 »

I ran into a problem the other day where Newsgator's export of OPML data wouldn't parse through MT-Outliner. Not a problem for me - I use Bloglines. But definitely a problem for some. It turned out that the problem was in the data. While XML doesn't really need whitespace, it looks like most everyone includes it in their OPML files, separating each entry into a separate line by using a carriage return or line feed (or both).

Not Newsgator. Their OPML export was just one long string of text. This broke MT-Outliner, as it didn't have anything to break up the data. All that was happening in the plugin was that it split the data and ran some regular expressions to pull out the field info. This was limited, but it was also pretty easy to do. Once the split went away, it meant that there wasn't data where it was expected.

For a while, I've known that MT-Outliner wouldn't really handle multiple levels of recursion - that is to say, folders within folders. It might print them, but it wouldn't be anything folder-like. Which meant I had two reasons to look at updating the code. So I did.

Using XML::Twig, I rewrote MT-Outliner to take advantage of XML parsing. This allowed me to actually pull data even if the line breaks had been left out. It also allowed me to process data hierarchically, and really take advantage of the structure that's always been there in the OPML document.

The problem is that XML::Twig requires XML::Parser, which in turn requires XML::Parser::Expat, which some of you may not have. What's worse is that it's not something you can install into EXTLIB and have it work. It must be compiled. So you may need help from your web host to get this going. If you're not sure, ask them.

For those of you who cannot get XML::Twig operating, the current version (1.3.0) of MT-Outliner will remain available for download, but it will receive no further development.