NAME

XML::Template::Parser - Document parsing module for XML::Template.

SYNOPSIS

use XML::Template::Parse;

my $parser = XML::Template::Parse->new ();
$parser->parse ($document);

DESCRIPTION

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.

CONSTRUCTOR

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:

my $parser = XML::Template::Parser->new (%config)
  || die XML::Template::Parser->error;

The following named configuration parameters are supported by this module:

String

A reference to custom attribute string parser.

PRIVATE METHODS

_init

This method is the internal initialization function called from XML::Template::Base when a new cache object is created.

PUBLIC METHODS

parse

$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.