Channels ▼

XML Publishing With AxKit

September, 2004: XML Publishing With AxKit

Jack J. Woehr is an independent consultant and team mentor practicing in Colorado. He can be contacted at

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:

  • Difficulty building prerequisites via the AxKit install.
  • Version problems with libxml2.
  • Having to manually modify XML::LibXML Version 1.58's perl-libxml-mm.c (creating a { block } to enclose the declaring and accessing of the local variable xmlChar *, decoded starting at line 968) to get it to compile: Classic C doesn't allow bare variable declarations except at the top of a function.
  • The book incorrectly (or outdatedly) indicates that the sample configuration file provided with AxKit is examples/example.conf, which does not exist. Currently, there is only the file demo/axkit.conf to be included from Apache's httpd.conf, and an .htaccess file provided by AxKit that provides other hints to the server.

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 (
  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 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.


Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags


<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags


<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

