Main > Programming > Libraries >

XML::Descent 0.0.4

XML::Descent 0.0.4

Sponsored Links

XML::Descent 0.0.4 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.009 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 821
Date added: 2007-07-31
Publisher: Andy Armstrong

XML::Descent 0.0.4 description

XML::Descent is a Perl module for recursive descent XML parsing.

SYNOPSIS

use XML::Descent;

# Create parser
my $p = XML::Descent->new({
Input => $xml
});

# Setup handlers
$p->on(folder => sub {
my ($elem, $attr) = @_;

$p->on(url => sub {
my ($elem, $attr) = @_;
my $link = {
name => $attr->{name},
url => $p->text()
};
$p->stash(link => $link);
});

my $folder = $p->walk();
$folder->{name} = $attr->{name};

$p->stash(folder => $folder);
});

# Parse
my $res = $p->walk();

The conventional models for parsing XML are either DOM (a data structure representing the entire document tree is created) or SAX (callbacks are issued for each element in the XML).

XML grammar is recursive - so its nice to be able to write recursive parsers for it. XML::Descent allows such parsers to be created.

Typically a new XML::Descent is created and handlers are defined for elements were interested in

my $p = XML::Descent->new({ Input => $xml });
$p->on(link => sub {
my ($elem, $attr) = @_;
print "Found link: ", $attr->{url}, "n";
$p->walk(); # recurse
});
$p->walk(); # parse

A handler provides a convenient lexical scope that lasts until the closing tag of the element that triggered the handler is reached.

When called at the top level the parsing methods walk(), text() and xml() parse the whole XML document. When called recursively within a handler they parse the portion of the document nested inside node that triggered the handler.

New handlers may be defined within a handler and their scope will be limited to the XML inside the node that triggered the handler.

XML::Descent 0.0.4 Screenshot

Advertisements

XML::Descent 0.0.4 Keywords

Bookmark XML::Descent 0.0.4

Hyperlink code:
Link for forum:

XML::Descent 0.0.4 Copyright

WareSeeker periodically updates pricing and software information of XML::Descent 0.0.4 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of XML::Descent 0.0.4 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
XML::Diff is a Perl module for XML DOM-Tree based Diff & Patch Module. Free Download
XML::DocStats is a Perl module to produce a simple analysis of an XML document. Free Download
XML::IODEF is a Perl module for building/parsing IODEF messages. Free Download
XML::Compile::Schema is a Perl module to compile a schema. Free Download
XML::DOM2 is a DOM controlled, strict XML module for extentable xml objects. Free Download
Parse::RecDescent is a Perl module to generate Recursive-Descent Parsers. Free Download
XML::SAX2Perl is a Perl module to translate Perl SAX methods to Java/CORBA style methods. Free Download
XML-Parse library is a lightweight set of re-usable functions for general purpose parsing, checking, and creating xml files. Free Download