XML::Parser::Wrapper 0.15

XML::Parser::Wrapper is a Perl module for parsing XML.
XML::Parser::Wrapper is a Perl module for parsing XML. XML::Parser::Wrapper is a wrapper on top of XML::Parser that provides a more friendly API.

SYNOPSIS

use XML::Parser::Wrapper;
my $xml = qq{Hello World!};
my $root = XML::Parser::Wrapper->new($xml);
my $root2 = XML::Parser::Wrapper->new({ file => '/tmp/test.xml' });
my $root_tag_name = $root->name;
my $roots_children = $root->elements;
foreach my $element (@$roots_children) {
if ($element->name eq 'head') {
my $id = $element->attr('id');
my $hello_world_text = $element->text; # eq "Hello World!"
}
}
my $head_element = $root->element('head2');
my $head_elements = $root->elements('head2');
my $test = $root->element('head2')->element('test_tag');
my $new_element = $root->add_child('test4', { attr1 => 'val1' });
my $kid = $root->update_kid('root_child', { attr2 => 'stuff2' }, 'blah');
$kid->update_node({ new_attr => 'new_stuff' });
$new_element->add_child('child', { myattr => 'stuff' }, 'bleh');
my $new_xml = $root->to_xml;

last updated on:
April 25th, 2012, 5:46 GMT
price:
FREE!
developed by:
Don Owens
homepage:
regexguy.com
license type:
Perl Artistic License 
category:
ROOT \ Text Editing&Processing \ Markup

FREE!

In a hurry? Add it to your Download Basket!

user rating 21

2.3/5
 

0/5

Add your review!

SUBMIT