The stupid question is the question not asked | |
PerlMonks |
Re: parsing multi level XML with XML::Simpleby dasgar (Priest) |
on Jan 26, 2012 at 05:25 UTC ( [id://950028]=note: print w/replies, xml ) | Need Help?? |
When using XML::Simple, it's usually very helpful to use something like Data::Dumper to help understand the structure of the data. From my personal experience, attributes are usually hash keys and multiple tags at a level are usually arrays. Here's the code that I came up with to parse your XML data and run it through Data::Dumper.
And here's the output.
That output should help you figure out how to write your code to traverse the data structure. If that's not a data structure that you're liking, you can check out the available options for the XMLin function or you might need to check out other XML parsing modules. Since I personally have only used XML::Simple, I can't really recommend any other modules to try.
In Section
Seekers of Perl Wisdom
|
|