XML::Handler::Trees 0.02 review
DownloadXML::Handler::Trees is a PerlSAX handlers for building tree structures. SYNOPSIS use XML::Handler::Trees; use XML::Parser:
|
|
XML::Handler::Trees is a PerlSAX handlers for building tree structures.
SYNOPSIS
use XML::Handler::Trees;
use XML::Parser::PerlSAX;
my $p=XML::Parser::PerlSAX->new();
my $h=XML::Handler::Tree->new();
my $tree=$p->parse(Handler=>$h,Source=>{SystemId=>'file.xml'});
my $p=XML::Parser::PerlSAX->new();
my $h=XML::Handler::EasyTree->new(Noempty=>1);
my $easytree=$p->parse(Handler=>$h,Source=>{SystemId=>'file.xml'});
my $p=XML::Parser::PerlSAX->new();
my $h=XML::Handler::TreeBuilder->new();
$h->store_pis(1);
my $tree=$p->parse(Handler=>$h,Source=>{SystemId=>'file.xml'});
XML::Handler::Trees provides three PerlSAX handler classes for building tree structures. XML::Handler::Tree builds the same type of tree as the "Tree" style in XML::Parser.
XML::Handler::EasyTree builds the same type of tree as the "EasyTree" style added to XML::Parser by XML::Parser::EasyTree. XML::Handler::TreeBuilder builds the same type of tree as Sean M. Burke's XML::TreeBuilder. These classes make it possible to construct these tree structures from sources other than XML::Parser.
All three handlers can be driven by either PerlSAX 1 or PerlSAX 2 drivers. In all cases, the end_document() method returns a reference to the constructed tree, which normally becomes the return value of the PerlSAX driver.
Requirements:
Perl
XML::Handler::Trees 0.02 keywords