Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by runrig (Abbot)
on Dec 21, 2012 at 18:24 UTC ( #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);


Comment on Re: A Perl module to parse an XML string by string?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-12-22 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls