NAME

XML::LibXSLT::Cache - Stylesheet cache for XML::LibXSLT

VERSION

version 0.10

SYNOPSIS

my $cache = XML::LibXSLT::Cache->new;

my $stylesheet = $cache->parse_stylesheet_file('file.xsl');

DESCRIPTION

XML::LibXSLT::Cache is a cache for XML::LibXSLT stylesheets loaded from files. It is useful to speed up loading of XSLT stylesheets in persistent web applications.

This module caches the stylesheet object after the first load and returns the cached version on subsequent loads. Stylesheets are reloaded whenever the stylesheet file changes. Changes to other files referenced during parsing also cause a reload, for example via xsl:import and xsl:include.

METHODS

new

my $cache = XML::LibXSLT::Cache->new(%opts);
my $cache = XML::LibXSLT::Cache->new(\%opts);

Creates a new cache. Valid options are:

xslt

The XML::LibXSLT object that should be used to load stylsheets if you want to reuse an existing object. If this options is missing a new XML::LibXSLT object will be created.

parse_stylesheet_file

my $doc = $cache->parse_stylesheet_file($filename);

Works like parse_stylesheet_file in XML::LibXSLT.

AUTHOR

Nick Wellnhofer <wellnhofer@aevum.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Nick Wellnhofer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.