XML::Descent 0.0.4
Sponsored Links
XML::Descent 0.0.4 Ranking & Summary
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.
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
XML::Descent 0.0.4 Keywords
XML
Descent 0.0.4
XML parsing
Recursive descent
Perl module
P-
parsing
handler
recursive
walk
parse
XML::Descent
XMLDescent
XML::Descent 0.0.4
Libraries
Programming
Bookmark XML::Descent 0.0.4
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
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
recursive descent parser
perl modules
java xml parsing
parsing xml in php
xml parsing error
Parsing table
php xml parsing
install perl module
xml parsing examples
recursive functions
handlery san francisco
parsing greek
recursive descent parsing
xml parsing in java
javascript xml parsing
chelsea handler
recursive algorithm
installing perl module
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
Latest Software
Popular Software
Favourite Software