in reply to The best way to handle different type of XML files

XML::Twig + XPath (either the XPath built-in to XML::Twig, or, if you need a bit more, XML::XPath will work with twig objects). Suddenly, you won't have to care about depth, just names. You may have to care about multiple names for a given value, such as //middle//name, or just //name, or include attributes or whatever, but it's all hierarchies of names, regardless of depth.

Of course, it's always nice to have a standard format for all your vendors to use, but, unless you're Walmart, good luck with that. :-)

  • Comment on Re: The best way to handle different type of XML files