Perils of the road less taken

Last month, Chad Dickerson wrote:

With Linux approaching ho-hum status in its ubiquity and MySQL getting its fair share of attention these days, there are still a few open source projects out there that sometimes slip under the hype radar...The free BSD derivatives -- FreeBSD, OpenBSD, and NetBSD -- have been around for years and deserve consideration alongside Linux. [CTO Connection

That's true. But as I was reminded yesterday, stepping off the Linux path can lead to serious headaches. A system on which I deploy some Zope-based applications used to run BSDI, and now runs FreeBSD. Building Python and Zope on the box was a lot trickier than it would have been on Linux, just because FreeBSD is the road less taken. I'd pretty much forgotten about that until yesterday, when I decided to add an XSLT processor to the mix. That proved way harder than it should have been.

The first choice was Xerces-C and Xalan-C. I had no luck getting Xerces-C built, though. Partly that's because the box is ISP-controlled and has a fairly minimal configuration, but partly -- I think -- it's because most of the Unix folk who build and run this software are doing so on Linux or Solaris.

The next option was to try the Java versions of Xerces and Xalan. But apparently, running Java on FreeBSD isn't exactly a cakewalk. You need to build Java from its sources, and even then, the available patches don't officially support recent JDKs.

I know there are people who enjoy doing this kind of thing. I'm not one of them. If I want an XSLT processor, it's because I need it for some project. When I find myself re-registering at in order to download the Java sources in order to build a JDK so that I can download the Xerces-J/Xalan-J sources, in order to build the XSLT processor that I wanted to use in the first place, I've learned to take a deep breath and regroup. It's all too easy to lose hours to a procedure like this and come up empty-handed.

After a refreshing oxygen break, I decided to give Sablotron a try. Here were the two statements that were good predictors of success:

Sablotron is a fast, compact and portable XML toolkit implementing XSLT 1.0, DOM Level2 and XPath 1.0.
Sablotron uses James Clark's expat XML parser.

I liked the sound of that! I know expat will work everywhere -- indeed, it's already working on this box, as part of my Python/Zope kit. And the 6MB of Xerces-C's compressed sources, plus 1MB of Xalan-C sources, does seem a tad hefty. Sablotron weighs in at .5MB of compressed sources, plus .3MB of expat's, which seems like it ought to be enough to do the job.

And sure enough, I did get it working, though I had to back off the latest expat-1.95.6 to the prior expat-1.95.5, and I haven't extensively tested Sablotron yet. Now, what was it I needed it for the first place? Oh, yeah, I remember. It was the project that, had I been working on a Windows server, I'd be deep in the middle of, because XML parsing and transformation are standard features of the Windows platform :-)

So the moral isn't just that Linux would have saved me some headaches. Really, the issue of XSLT support shouldn't even have come up. It ought to just be there. The fact that it isn't standard on Linux, or FreeBSD, or Mac OS X for that matter, doesn't speak well for these platforms.

Former URL: