XML::Template::Parser - Document parsing module for XML::Template.
use XML::Template::Parse; my $parser = XML::Template::Parse->new (); $parser->parse ($document);
This module provides XML document parsing for XML::Template. Whenever a plug-in element type is encountered, a subroutine in the associated Element module is called. However, only plug-in elements whose namespaces have been defined in the document will be processed. Much of the default element and attribute processing behavior can be modified in the XML::Template config file. See xml-template.conf for more information.
xml-template.conf
A constructor method new is provided by XML::Template::Base. A list of named configuration parameters may be passed to the constructor. The constructor returns a reference to a new parser object or undef if an error occurred. If undef is returned, you can use the method error to retrieve the error. For instance:
new
XML::Template::Base
error
my $parser = XML::Template::Parser->new (%config) || die XML::Template::Parser->error;
The following named configuration parameters are supported by this module:
A reference to custom attribute string parser.
This method is the internal initialization function called from XML::Template::Base when a new cache object is created.
$parser->parse ($document) || die $parser->error;
This method initiates XML document parsing. It takes a single parameter, a reference to an XML::Template::Document object, which contains the actual XML text.
parse returns 1 if the parse was successful, other wise it returns undef.
parse
undef
To install XML::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Template
CPAN shell
perl -MCPAN -e shell install XML::Template
For more information on module installation, please visit the detailed CPAN module installation guide.