XML::LibXML::Cache - Document cache for XML::LibXML



NAME

XML::LibXML::Cache - Document cache for XML::LibXML


VERSION

version 0.12


SYNOPSIS

    my $cache = XML::LibXML::Cache->new;
    my $doc = $cache->parse_file('file.xml');
    my $doc = $cache->parse_html_file('file.html', \%opts);


DESCRIPTION

XML::LibXML::Cache is a cache for the XML::LibXML manpage documents loaded from files. It is useful to speed up loading of XML files in persistent web applications.

This module caches the document object after the first load and returns the cached version on subsequent loads. Documents are reloaded whenever the document file changes. Changes to other files referenced during parsing also cause a reload. This includes external DTDs, external entities or XIncludes.


METHODS

new

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

Creates a new cache. Valid options are:

parser
The the XML::LibXML manpage parser object that should be used to load documents if you want to use certain parser options. If this options is missing a parser with default options will be used.

parse_file

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

Works like parse_file in the XML::LibXML::Parser manpage.

parse_html_file

    my $doc = $cache->parse_html_file($filename, \%opts);

Works like parse_html_file in the XML::LibXML::Parser manpage.


AUTHOR

Nick Wellnhofer <wellnhofer@aevum.de>


COPYRIGHT AND LICENSE

This software is copyright (c) 2012 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.

 XML::LibXML::Cache - Document cache for XML::LibXML