Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: A Perl module to parse an XML string by string?

by runrig (Abbot)
on Dec 21, 2012 at 18:24 UTC ( [id://1009946]=note: print w/replies, xml ) Need Help??


in reply to A Perl module to parse an XML string by string?

An example with XML::Rules
use XML::Rules; my $xml = <<XML; <root> <mynode id='500'> </mynode> <mynode id='500'> </mynode> </root> XML my @rules = ( # Only get 'mynode' directly under root mynode => [ '/root' => sub { print "$_[1]->{id}\n"; return }, _defau +lt => undef ], _default => undef, ); my $xr = XML::Rules->new(rules => \@rules); $xr->parse($xml);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1009946]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-25 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found