Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Reading multi-level-tag XML file

by runrig (Abbot)
on Jul 27, 2015 at 16:35 UTC ( [id://1136493]=note: print w/replies, xml ) Need Help??


in reply to Reading multi-level-tag XML file

With XML::Rules:
use warnings; use strict; use XML::Rules; my %data; my $seller_id; my @rules = ( Seller => sub { $seller_id = $_[1]->{sellerIdFromProvider} }, TaxableLocation => sub { push @{$data{$seller_id}}, $_[1]->{location +Value} }, _default => undef, ); my $xr = XML::Rules->new( rules => \@rules ); $xr->parsefile('file.xml'); use Data::Dumper; print Dumper \%data;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-28 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found