The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache2::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 -->

Please note all relative paths are prefixed with the document-root if AxNoCompilance is set to 0. If AxNoCompilance is set to 1 all paths are relative to the root path!

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

AxNoCompilance 0|1

This turns off AxKit-Compilance which is not given out-of-the box. Chdir to document-root is possible automagically because of threading issues. Please note that running with no AxKit-Compilance may be faster and can be achieved by evaluating the special parameter "_TOMKIT_DocumentRoot" which is passed to XSLT-Processors.

AxEnableCGICache 0|1

Setting this flag to true the cgi-parameters passed are also taken into consideration when the cache-key is generated.

AxCacheDir /path/to/cache

You can configure the path where TomKit restores the cached results. If you don't set any the default location is created using 'File::Spec->tmpdir() . "/axkit"'

AxDebugLevel 1-n

You set the debug-level verbosity of TomKit to debug your XSLTs the default level is 0 where only errors are logged

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.