in reply to Re: Parsing XML file for more than 1 child element with attributes (XML::Twig)
in thread Parsing XML file for more than 1 child element with attributes

Just for the record, XML::Simple does choke on the non-well-formed XML. It dies with a very useful message.

I fixed the bad XML but didn't mention it for my example.



Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...
  • Comment on Re^2: Parsing XML file for more than 1 child element with attributes (XML::Twig)

Replies are listed 'Best First'.
Re^3: Parsing XML file for more than 1 child element with attributes (XML::Twig)
by Anonymous Monk on Feb 07, 2008 at 06:40 UTC
    Thanks Cody Pendant and Tanktalus. my $simple = XML::Simple -> new (KeyAttr => 'node'); I thought the above was simple as the xml tree is returned as an hash of an hash and so on. But when i saw the structure entries like and made me think. Since i want a subroutine it will be easy for me to use. Hence i plan to use use XML::Twig; I can pass the XML as a string, mid and name to the subroutine. The return from the subroutine can be the values and timestamps.