Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: XML::LibXML - WHAR HASH TREES WHAR?!

by hardburn (Abbot)
on Jul 15, 2011 at 15:31 UTC ( #914631=note: print w/ replies, xml ) Need Help??


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

DOM may be terrible in some ways, but it's not LibXML's fault for following it. People expect that nearly any widely used language out there will have a DOM parser. That way, we can all suffer equally.

I suspect what you want is XML::Simple.


"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.


Comment on Re: XML::LibXML - WHAR HASH TREES WHAR?!
Re^2: XML::LibXML - WHAR HASH TREES WHAR?!
by SineSwiper (Beadle) on Jul 15, 2011 at 18:43 UTC

    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);

      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.)

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://914631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-08-21 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls