in reply to Re: XML::LibXML - WHAR HASH TREES WHAR?!
in thread XML::LibXML - WHAR HASH TREES WHAR?!

All I want is the most powerful and best XML parser available. XML::LibXML is fast, linked to a very common lib, and regularly updated. However, it's bedside manner has something to be desired. XML::Simple has been regarded as the easier of the two, but not the best.

Why does both have to suck in opposite but equal manners? What's wrong with having both the power of the methods and tying it to a hash tree? You can put a hash tree on top of the methods. What's wrong with something like this?

$pXML->{bookstore}{book}[3]->appendText(", The"); my @books = $pXML->('//book'); $node->('/bookstore/book[price>35]/price')->setData(24.95);

Replies are listed 'Best First'.
Re^3: XML::LibXML - WHAR HASH TREES WHAR?!
by ikegami (Patriarch) on Jul 15, 2011 at 19:10 UTC

    XML::Simple has been regarded as the easier of the two.

    XML::Simple is the hardest XML parser to use.

    $smart->{book}('@')
    is
    ref($simple->{book}) && ref($simple->{book}) eq 'ARRAY' ? $simple->{book} : [ $simple->{book} ]
    or
    ForceArray => [qw( book )] # In constructor $simple->{book}

    XML::Smart appears to be an attempt to fix this problem of XML::Simple. (It still suffers from other problems of XML::Simple.)

Re^3: XML::LibXML - WHAR HASH TREES WHAR?!
by hardburn (Abbot) on Jul 15, 2011 at 19:27 UTC

    LibXML is doing things that way for perfectly defensible reasons. It's a thin wrapper around a C library.

    If you'd like to simplify things on top of that, then by all means, start a project to fix it. Complaining about it on in SoPW, though, is unproductive.


    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      And I'm actually fine with that. I was just asking if I wasn't reinventing the wheel, though.