[XML4Lib] tomkit, or sonne of axkit

Eric Lease Morgan emorgan at nd.edu
Tue Nov 7 07:31:49 EST 2006


This note sings some praises for a Perl module called TomKit, or  
Sonne of AxKit.

I have been spending the past month or so moving Infomotions from one  
piece of hardware to another, but that is another story. In my new  
implementation I have decided to use things like yum to a greater  
extent. Generally speaking this gives me the freedom from compiling  
bunches o' stuff and maintaining various distributions. On the other  
hand, yum is not always "up-to-date" and things may not be compiled  
into the distro's as I would desire.

One such thing was Apache and mod_perl. It has been long over due,  
but I have (finally) upgraded to Apache 2.0. This is/was working fine  
until I wanted to re-implement my water collection. Based on AxKit,  
my water collection was suddenly dead in the... water because AxKit  
does not work under Apache 2.0. I did my best to download and install  
newer versions of AxKit, all to no avail. Moreover AxKit 2.0 seems to  
be moving towards some kind of application server and totally away  
from mod_perl. As I read deeper the documentation pointed me to a  
similar application called TomKit. I had nothing to loose, so I  
followed the lead.

TomKit, found on CPAN, is a set of mod_perl modules allowing you to  
transform arbitrary XML with arbitrary XSL and output things like  
HTML. This is exactly how my water collection was designed to function.

As I did a "make test" the distribution complained about the lack of  
a module called Apache2::Request. Going back to CPAN I discovered the  
need for an additional C library and accompanying Perl module written  
by the author of TomKit. Compiling was tricky only because I did not  
have the necessary include files for mod_perl. Back to yum. Search  
for headers. Find them. Yum install. Configure. Make. Whew! Next I  
had to make test for the C library, and the instructions told me to  
move everything to /tmp because of permission issues. Fine.  
Everything compiled, and installed. I then had to update httpd.conf  
to include the new C library. I also had to bring my linking  
definitions up-to-date (ldconfig).

Back to TomKit and everything installed painlessly. Perl Makefile.PL.  
Make. Make test. Sudo make install.

I then edited my httpd.conf file to allow XML transformations. Going  
on the examples from TomKit's POD I was stuck. Transformations did  
not occur. I consistently got things like "file not found" errors. I  
broke down and emailed the author. (He lives in Austria.) I got a  
reply in less than thirty minutes. "Change this path", he said. Ta  
da! That worked. Things transformed.

All was not perfect. My XML/XSL expects name/value pairs as  
parameters thus altering the output. Email again. Reply quickly.  
"Include this line in your httpd.conf configuration, and check out  
the various t/*.t files." That didn't work. Sigh. Looking at the t/ 
*.t files I noticed none of them included the line to which the  
author referred. Searching my file system I noticed the file in the  
line was not even on my file system. Using subversion (which had  
automatically been installed) I downloaded the author's development  
tree, found the necessary file, and installed. Ta da! My name/value  
pairs now worked.

My water collection is now all but moved from one machine to another,  
all in less than forty-eight hours. In retrospect, the process was  
not too difficult:

   * Compile and install C library
   * Install Perl modules
   * Edit httpd.conf
   * Create XML/XSL combinations
   * Go

TomKit may or may not be 100% compatible with AxKit, but it includes  
the functionality I require. As AxKit dies its slow death I was able  
to migrate from one platform to another for a number of reasons:

   1) I relied on standardized technology,
      namely XML and XSLT.

   2) The network allowed me to communicate
      VERY quickly and directly with the
      developer.

   3) Open source software allowed me to
      investigate alternatives and solutions
      before making the ultimate commitment
      in time and money.

Let's hear it for XML, the Internet, and open source software!  
Alternatively, if you use AxKit and you want to migrate to Apache  
2.0, then consider using TomKit.

-- 
Eric Lease Morgan
University Libraries of Notre Dame




More information about the XML4Lib mailing list