in reply to How I can change value in XML file ?

FYC: XML::LibXML has sparser docs and fewer tutorials than the very capable XML::Twig but it is a widely used lib underneath and if you learn its API, you'll be learning things that can transfer to many other places.

  • Comment on Re: How I can change value in XML file ?

Replies are listed 'Best First'.
Re^2: How I can change value in XML file ?
by graff (Chancellor) on Aug 05, 2010 at 02:42 UTC
    Maybe I'm just "different", but in my own experience, the man pages that come with XML::LibXML are actually easier to use than the manual for XML::Twig. (Sometimes "less is more": another way of saying that the LibXML docs are "sparser" is that they are more concise).

    Apart from that, LibXML runs a lot faster, and tends to impose a much smaller memory footprint when it comes to handling a large XML structure.

      Yeah, in fact. Now I find the XML::LibXML docs quite nice but when I was starting with it way back when it was maddening. You need a decent understanding of the DOM and iterators and such to know which of the many docs to check. Once you do, they're great. Before that… uh… wha?

        When a ::Parser object parses a document, it returns a ::Document object. A ::Document object holds a tree formed of ::Node objects. The ::Node class is the base class of everything in the tree, including ::Attribute objects (which represent attributes) and ::Text (which hold the text body of elements). You'll deal primarily with ::Element objects, which represent XML elements.

      Yeah, if you misuse XML::Twig and force it to keep the whole file in memory.

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