Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Parsing XML

by runrig (Abbot)
on Mar 13, 2013 at 20:20 UTC ( #1023290=note: print w/ replies, xml ) Need Help??


in reply to Parsing XML

First, that's not valid XML, the &'s are not entity encoded, and the namespaces are not declared, but I assume you really do have valid XML otherwise XML::Simple could not parse it. Whatever you get back from XML::Simple, you can use Data::Dumper to see the structure of the data it returns. Or you can only process the things you want to process the way you want to process them with something like XML::Rules:

use XML::Rules; my @rules = ( 'm:properties' => sub { my $p = $_[1]; print "Title : $p->{'d:Title'}\n"; print "Description: $p->{'d:Description'}\n"; }, _default => 'content', ); my $xr = XML::Rules->new( rules => \@rules, ); $xr->parse($xml);


Comment on Re: Parsing XML
Download Code
Re^2: Parsing XML
by DanielSpaniel (Scribe) on Mar 13, 2013 at 21:15 UTC
    Thank you runrig!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-09-20 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls