in reply to Re^2: XML::Simple parsing into a hash wierd behaviour
in thread XML::Simple parsing into a hash wierd behaviour

I don't disagree with the principle, but the devil is in the details.

And then there are the limitations of XML::Simple.
  • Comment on Re^3: XML::Simple parsing into a hash wierd behaviour

Replies are listed 'Best First'.
Re^4: XML::Simple parsing into a hash wierd behaviour
by Jenda (Abbot) on Apr 21, 2010 at 10:31 UTC

    I do not use XML::Simple myself, now that I've written XML::Rules, but it worked fine for me. Most probably because I was working within the limits of what it was designed for. Of course I had to add a few ForceArrays, but it still was the easiest solution. Because I did not need no namespaces, I did not intend to work with document oriented XML, I did not have to handle any optional attributes, ...

    Query mechanisms have two problems ... it's yet another language to learn and debug and it's slow. Compared to navigating a trimmed down data structure, navigating a generic maze of objects must be slow. Of course if you need to navigate far over a complicated path, then the query mechanisms may very well be easier. They probably will. If on the other hand you need to process pretty much everything, your query mechanisms will not help you much. The ->nodeValue()s and ->getAttribute()s all over the place will hurt though.

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

      Query mechanisms have two problems ... it's yet another language to learn

      I'd rather learn

      Persons/Person
      then learning to do
      GroupTags => { Persons => 'Person' }, ForceArray => [qw( Person )], my @persons = $parent->{Persons} ? @{ $parent->{Persons} } : ();

      and it's slow.

      That's not the case. XML::Simple is still *far* slower.

      The ->nodeValue()s and ->getAttribute()s all over the place will hurt though.

      I have no problem with a little more wordiness in a series of cut and paste lines if all trickiness goes away in exchange.