XSLT

davorg on 2002-03-12T19:40:01

I've been learning XSLT. It's something that I've been meaning to learn for some time, but all the books I've looked at before have just left me confused. For some reason I'm finding the new(ish) O'Reilly XSLT book a lot easier to follow. It only took me about an hour to create an XSLT document to convert my CV from XML to XHTML.

The next step is to convert it into other formats like PDF and postscript and for that you need XSL-FO. The ORA book doesn't cover that in any depth but I've found an online book by Dave Pawson which seems pretty useful. And there's always the complete W3C specs to fall back on. It's far from complete, but I'm certainly making progress on creating a PDF of my CV.

I feel a bit dirty tho'. The tools I've been using have been written in Java. I've been using Xalan for XSLT and Fop for XSL-FO. It's the first time I've really used any kind of Java tools - so it's been a very quick lesson in .jar files and CLASSPATHs and the like[1]. I'm actually starting to understand it now.

I still don't like Java as a programming language tho'. I'm just using the tools :)

[1] Why don't java class libraries come with an installation script that automatically installs the classes into a standard directory? That's one area where Perl scores heavily over Java IMO.


Welcome to the joyous world of XSLT

darobin on 2002-03-12T19:49:41

You might want to look at stuff inside AxKit for PDF conversion. There's AxPoint (also available outside of AxKit) and Apache::AxKit::Language::PassiveText (not available outside I think, though I guess that could change).

Both are definitely interesting.

XSLT tools

ziggy on 2002-03-12T20:09:30

Why don't java class libraries come with an installation script that automatically installs the classes into a standard directory? That's one area where Perl scores heavily over Java IMO.
I think you'd be spending your time better if you asked Andreas and Jarkko why Perl modules generally do the right thing when you try and install them. :-)

All of the best XSLT tools are written in C (or Perl) these days, even if most of the XSLT tools are written in Java. Go figure. Daniel Veillard's libxslt (and libxml) is by far one of the fastest XSLT processors on the planet at the moment. Your best bet for converting XSL-FO to PDF at the moment is through TeX, specifically pdfxmltex, which builds upon Sebastian Rahtz's passivetex and (I forget the maintainer's name) pdfTeX.

Then there's AxPoint, which is taking a very unique and underrated approach - create PDF directly from a well-defined XML vocabulary (and one that uses British spelling, no less!).

 

As far as the first batch of XSLT books, they were all pretty atrocious. The latest batch seem to be much better. Sadly, the W3C loves using spec-ese to create these vocabularies, which makes it quite difficult to parse and understand. XPath 1.0 + XSLT 1.0 are notoriously bad (but not as bad as some other specs, like XML Schema). The good news is that all of the pieces are falling into place, now (finally), even if they weren't quite ready for prime time before.