ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:

What is the basic difference between XML::libXML and XML::DOM modules? I want to parse a XML file(in my case : very large XML file) and do certain modifications to its elements. which one should I use?

Replies are listed 'Best First'.
Re: How to parse and modify an XML file ?
by Athanasius (Archbishop) on Sep 21, 2016 at 06:31 UTC
Re: How to parse and modify a XML file ?
by Discipulus (Canon) on Sep 21, 2016 at 11:51 UTC
    If you want to parse a XML file(in my case : very large XML file) and do certain modifications to its elements. you have another handy option: XML::Twig

    twig_handlers is the method you look for to process a large file without loading it in memory, see XML_Twig_101_Processing_an_XML_document_chunk_by_chunk

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: How to parse and modify a XML file ?
by Anonymous Monk on Sep 21, 2016 at 06:39 UTC

    What is the basic difference between XML::libXML and XML::DOM modules?

    XML::DOM is a perl module. It uses/depends on XML::Parser/libexpat. Xpath support via third party XML::DOM::XPath

    XML::LibXML is just an interface to gnomes libxml2 which is written C and supports DOM/xpath natively.

    LibXML is faster and more memory efficient, but before strawberryperl wasn't as easily install-able on windows as XML::DOM

    which one should I use?

    XML::LibXML, and xpather.pl