in reply to XML Parsing Problems

XML::Simple is not the best solution for a complex XML structure like that. Much better solutions are XML::LibXML with its findnodes functions, which takes XPath expressions (one decent introductory resource on that is http://www.w3schools.com/xpath/), XML::Twig, and I've seen XML::Rules recommended a few times (although I can't yet speak from experience on that one). If you don't like XML::LibXML's interface then give XML::Twig a try.

Replies are listed 'Best First'.
Re^2: XML Parsing Problems
by Discipulus (Canon) on Jun 09, 2015 at 07:21 UTC
    XML::SImple STATUS_OF_THIS_MODULE
    The use of this module in new code is discouraged. Other modules are a +vailable which provide more straightforward and consistent interfaces +. In particular, XML::LibXML is highly recommended. The major problems with this module are the large number of options an +d the arbitrary ways in which these options interact - often with une +xpected results. Patches with bug fixes and documentation fixes are welcome, but new fe +atures are unlikely to be added.
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: XML Parsing Problems
by Jenda (Abbot) on Oct 13, 2015 at 11:25 UTC

    It's much easier to switch from XML::Simple to XML::Rules than to XML::LibXML. Basically all you need is to give XML::Rules::inferRulesFromExample a few example XMLs (make sure all tags that may be repeated actually are repeated at least in one xml and make sure tags that only have optional attributes do have a attribute at least once) or use XML::Rules::inferRulesFromDTD to produce a set of transformation rules and you end up with a data structure very similar to the one produced by XML::Simple, with the only important difference being its consistency.

    You can then tweak the rules to skip parts you are not interested in, (pre)process branches of the XML, etc.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.