NAME

AGAVA::AGE::Framework::Library::XML::XPath::Cached - XPath sublass to cache parsed XML content.

SYNOPSIS

$xpath = new AGAVA::AGE::Framework::Library::XML::XPath::Cached (
				filename => "file.xml", xsdFilename => "file.xsd");
				

DESCRIPTION

This class is a drop-in replacement for XML::XPath designed to:

  • speed things up by caching parsed XML content

  • validate XML content against XML schema

METHODS

new (filename => file.xml, xsdFilename => file.xsd)

Constructor. Options are:

filename - mandatory

input XML file (if '/' is not present in its name, it's not unique cache-wide and an exception is thrown (Cwd::realpath() is sometimes buggy and returns undef)

xsdFilename - optional

XML schema file to validate XML content against

xmlSimple - hashref

what to pass to XML::Simple::XMLin() - ForceArray=1 and KeyAttr=>[] are enforced to guarantee XML is treated as safely as possible

toXMLSimple()

Pipes XML file to XML::Simple, returns what XMLin returns.

NOTE: ForceArray=1 is always passed, so all tags are arrayrefs! Also, KeyAttr=[] is passed to disable array folding based on attr names.

find

Method borrowed from parent class and patched to use cache, if any. See parent class for method description.

NOTE: for some reason, in real life projects nodeset caching turned out to be SLOWER, than no caching, so currently this method DOESN'T USE CACHING.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 57:

You can't have =items (as at line 65) unless the first thing after the =over is an =item