NAME

TomKit - Perl Module used to Transform Content

SYNOPSIS

<Files *\.xml>
  PerlFixupHandler Apache2::TomKit

  PerlSetVar AxAddProcessorDef "text/xsl=>base.xsl"
  PerlSetVar AxAddProcessorDef "text/xsl=>html.xsl"

  PerlSetVar AxAddProcessorMap "text/xsl=>Apache2::TomKit::Processor::LibXSLT"

  PerlSetVar AxContentProvider My::Content::Provider
</Files>

DESCRIPTION

TomKit is a perl handler which is working similar as the famous AxKit for mod_perl 1.x. It is designed as an PerlFixupHandler which inserts an OutputFilter if needed to transform XML-Content.

Although designed primarily to transform XML-Content it can be used to create any arbitary output like e.g. PNG, ... . The big advantage is the easy to configure caching behaviour.

TOMKIT DIRECTIVES

TomKit is configured by setting configuration variables using PerlSetVar like shown in the synopsis.

AxAddProcessorDef

Configure the processor definition file used by the processor. The format of the looks like the following:

${typeMape}=>${relative_path_from_document-root_2_definition}

You can use add more than one processor. They are restored in a processor chain and run next to each other.

You don't necessarily have to set the processor definition in the configuration. TomKit has the possibility to read the processor definitions directly from the processed file. This looks like the following:

<?xml version="1.0" ?>
<?xml-stylesheet href="base.xsl" type="text/xsl"?>
<?xml-stylesheet href="html.xsl" type="text/xsl"?>
<!-- THE START OF THE XML-FILE -->

<!-- .... -->

<!-- THE END OF THE XML-FILE -->

AxAddProcessorMap

Configure the processor used to transform the input-source. The format looks like the following:

${typeMape}=>${Name::Of::The::Processor}

AxContentProvider

Configure the content provider which provides the content to the transformer chain as its name indicates. If you don't configure a AxContentProvider there are 2 possibilities:

  • default response handler

    the default response handler of apache is used. This means caching is avaiable out of the box and done automatically by TomKit for you

  • another apache-module

    a content handler is another apache-module e.g. PerlResponseHandler. Although very cool it has the disadvantage that caching is not available out-of-the-box. To use caching possibilities TomKit provides to you your ResponseHandler has 2 possibilities:

    • use a notes-slot to pass information

      setting the AxMTime to the value the content has modified last time

    • headers flag

      setting AxMTime in the HTTP-Header

SEE ALSO

Apache2, Apache2::TomKit::IProvider

AUTHOR

Tom Schindl, <tom.schindl@bestsolution.at>

SUVERSION AND BUG-TRACKING

The latest version of the application can be found on my companies publicsvn-Server: http://publicsvn.bestsolution.at/repos

Bugtracking is done using mantisbt which can be found at here: http://phpot.bestsolution.at/mantis/main_page.php

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Tom Schindl and BestSolution Systemhaus GmbH

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.