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.

Related Entries

Comments (3)

I'm having a strange time getting this plug-in up and running. It seems to really hate me, or something. Running MT 3.16. I have all the perl modules listed on this page installed.

I used an example snippet from the docs, change the appropriate attribute, and saved, rebuilt the template.

here's the result. here's the opml. here's the template code.

I don't even get an error message anywhere. Rebuilding, in my MT Activity Log... Nowhere. It's very strange. I even tried the 1.3.0 release before installing 2.0.0. Same result. Yes, the opml is a saved export from Bloglines, but I've been trying to reduce the number of potential unknowns and have had no luck at all.

I took a look at your pages, and they contain end tags (for instance, </MTOutlinerItems>), but no start tags. This generally indicates that the plugin isn't installed correctly - so it processes the tag, but since it cannot figure out how to handle it, it just dies (and leaves the end tags).

With version 2.0, do you see MT-Outliner installed in the plugins list on your main menu? If not, then it definitely won't work in your templates.

When you installed XML::Parser, how did you do so? That is, did you simply add it to your extlib, or did you actually compile it into your install using the command line (or have your host do it for you)?

I'm sure I'm overlooking something obvious, but I can't seem to find a download link for version 2.0 of the plugin. Can you point me in the right direction? Thanks :)

Post a comment