in reply to Problem with parsing an XML using XML::Simple

Use Data::Dumper to dump the datastructure provided by XML::Simple's XMLin() function. That will tell you almost everything you need to know about where to find the data you're looking for.

I say almost, because the datastructure will take on a different form at the slightest whiff of change to your incoming XML. For that reason, I prefer a more robust parser such as XML::LibXML, or XML::Twig. But if your XML is unlikely to change much (for example, ShoeBank always has more than one set of shoe(s), XML::Simple is enticing for its ease of use.


Dave

Replies are listed 'Best First'.
Re^2: Problem with parsing an XML using XML::Simple
by chrestomanci (Priest) on Aug 18, 2011 at 09:16 UTC

    You can also use the perl debugger to examine the data structure produced by XMLin().

    The problem of the data structure changing if the incoming XML changes can mostly be fixed by passing the ForceArray option to XMLin() so that the nesting level of parameters you are interested in does not change when the number of nodes above changes.