New module XML::Traverse::ParseTree

Hello,
I'm happy to announce a new module XML::Traverse::ParseTree (v 0.02)

This module aims to simplify the access to the contents of a xml
document. When DOM-approach is the one and a SAX-parser-approach
the other extreme, then XML::Traverse::ParseTree strikes a balance between
them.

Parsing has to be done by means of XML::Parser, XML::Traverse::ParseTree
delivers getters and iterators. Access paths are specified in a xpath-like
syntax.

E.g.:
my $xml = XML::Parser->new(Style => "Tree")->parse($xmlcont);
my $h = XML::Traverse::ParseTree->new();

my $a1 = $h->get($xml,'document','structure','sections');
my $i = $h->get($a1,'section[*]','item[*]');
while (my $e = $i->()) {
...
$attr = $h->get($e,'another-child-element',' [at] attribute-name');
$text = $h->get($e,'#TEXT');
}


You can download this package from CPAN:

http://search.cpan.org/~mbusik/XML-Traverse-ParseTree-0.02/

Feedback will be appreciated.

Cheers,
Martin
Martin Busik [ Mo, 23 Oktober 2006 23:57 ] [ ID #1512166 ]
Perl » comp.lang.perl.modules » New module XML::Traverse::ParseTree

Vorheriges Thema: Error installing Apache::Request
Nächstes Thema: trying to use HTML::Mason on apache2 but scripts come up as plaintext in the browser