XML Publishing With AxKit

XML Publishing with AxKit covers a new Perl CPAN tool that manages, collates, and transforms XML to output specs; for example, HTML, PDF, and the like. It's useful and useable to the Perl CGI programmer, to the technical writer, and to the staff programmer at a publishing house.


September 01, 2004
URL:http://www.drdobbs.com/xml-publishing-with-axkit/184416151

September, 2004: XML Publishing With AxKit

Jack J. Woehr is an independent consultant and team mentor practicing in Colorado. He can be contacted at http://www.softwoehr.com/.


XML Publishing with AxKit
Kip Hampton
O'Reilly Media, 2004
216 pp., $29.95
ISBN 0596002165

XML Publishing with AxKit covers a new Perl CPAN tool that manages, collates, and transforms XML to output specs; for example, HTML, PDF, and the like. It's conceptually a generalization or factor of something like DocBook. It's useful and useable to the Perl CGI programmer, to the technical writer, and to the staff programmer at a publishing house.

Author Kip Hampton does a reasonably good job of identifying the niche and a better job of taxonomizing AxKit itself. Rather than burble 1990's-style about the wonders of XML, I would have started the book, "If you need XML transforms and you're surfeited with Java..." because that is the case here. Nothing that AxKit does in the field of XML transforms is left undone by Java, and that which is done in Java is done by more programmers using more mature tools than AxKit. But since many, if not most, programmers are surfeited with Java, they would have read on anyway.

XML Publishing with AxKit hyperbolically asserts that AxKit "turns Apache into an XML publishing and application server." There's a lot more to application serving than publishing transforms. The management of transactional data objects is the crux of most or all real-world web applications and the subject matter of most application-server XML. AxKit provides no data object facilities of the sort that Enterprise Java does. The AxKit enthusiast, having built the cart first, may turn to Perl DBI and discover that there is insufficient horsepower for high-volume, real-time transaction processing. Not that such things aren't done in Perl, but the Perl programmer doing transaction processing will usually spend a higher percentage of his/her time writing functions as opposed to describing data objects than will an Enterprise Java programmer. Perl programmers are largely those who prefer functional to declarative programming, so I'm probably worrying about nothing.

AxKit, like all modern tools—especially Perl CPAN tools—is primarily a pipeline of other tools. As with other such pipelines, extensibility and integration with tools such as XPathScript is its strength. However, AxKit is also very much a work in progress. AxKit doesn't support Apache 2, nor does it support recent versions of libxml2. Nonetheless, if you're bound and committed to doing it in Perl (whatever "it" is), then AxKit, or what AxKit becomes when it is more fully developed by its creators and maintainers, is the way to do it. It's a timely and clever idea that brings sophisticated programmatic XML transformations within reach of the scripter.

The book has the potential to baffle the less experienced user at installation time, to baffle them to the point of never completing the installation of AxKit. It took me about six hours of fiddling around to install AxKit completely and get it running. Among the problems were:

It's true that I'm not sitting in front of the latest-and-greatest canned Linux release: I'm maintaining my own rich, variegated, and mature open-source software toolchain on Solaris 9. It's not an exotic environment, nor is it in any way hostile to open-source development or Perl. One surmises that the author, while writing this book sitting in front of an ideal platform optimized for AxKit, either neglected to mention the sorts of problems that ordinary users might encounter or shrugged them off as endemic to the CPAN approach, where modules can change asynchronously with respect to both underlying compiled libraries and companion modules.

The best procedure for building a minimally useful AxKit is as follows:

  1. Download, configure, build, and install (or make sure you already have) Perl 5.8.x.
  2. Download, configure, build, and install libxml2 Version 2.6.8 (http://xmlsoft.org/).
  3. Download, configure, build, and install libxslt (http://xmlsoft .org/), which is apparently not version sensitive.
  4. Use the Perl cpan tool to install Apache::Test and Error (if you have not already done so).
  5. Use the Perl cpan tool to install XML::LibXML and XML::LibXSLT.
  6. Use the Perl cpan tool to install AxKit.

If, in the course of the build, you discover that mandatory prerequisites not mentioned above are missing, the easiest and most reliable procedure is to control-C out of cpan, and restart and install the prerequisite directly, rather than allowing the cpan tool to chain multiple prerequisite builds. Build chaining is a nice feature of the cpan tool, only it doesn't always work well, and it works spectactularly poorly in the AxKit build.

The web site for the book is http://www.oreilly.com/catalog/ xmlaxkit/ where the usual table of contents, sample chapter, and errata can be found. As of this writing, none of the example code from the book is provided.

TPJ

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.