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

XML::Twig, or something else?

by Anonymous Monk
on Jan 20, 2003 at 15:35 UTC ( #228361=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

I need to parse several large XML files, and add more XML as needed. I have looked into both XML::Parse, and XML::Twig. The Twig module seems to be more low level, but unfortunately it doesn't work on my windows box.

Does anyone have any suggestions for another module that would accomplish the same thing?


Replies are listed 'Best First'.
Re: XML::Twig, or something else?
by hotshot (Prior) on Jan 20, 2003 at 16:03 UTC
    It depends on what you wish to acomplish:
    from ajt's answer to similar question:

    Perl has many other excellent XML tools (including):

    XML::LibXML and XML::LibXSLT are also c based, and very fast - a particular favourite
    XML::DOM if you need a W3C DOM interface
    XML::GDOME if you need a DOM level 2 iterface
    XML::Parser if you want low level access to your XML
    XML::Sablotron another fast c based parser/XSLT engine
    XML::Simple a classic simple interface to XML in Perl
    XML::TreeBuilder a useful yet underused XML tree manipulation module
    XML::Twig another Perlish XML interface

Re: XML::Twig, or something else?
by gjb (Vicar) on Jan 20, 2003 at 16:15 UTC

    XML::Twig 3.0.9 installs nicely under Windows NT (SP5) with ActiveState Perl 5.6.1 build 633 for me. If memory serves I also installed it under cygwin with that Perl distribution directly from CPAN.

    I must say I rather like XML::Twig's approach, although the other modules mentioned have their advantages too.

    Lastly, for large files, you may want to use the SAX interface rather than the DOM unless you've lots of memory to spare. In such situations, XML::Twig may be a nice compromise.

    Just my 2 cents, -gjb-

Re: XML::Twig, or something else?
by ajt (Prior) on Jan 20, 2003 at 16:18 UTC

    Hi Anon,

    You should find that XML::Twig works perfectly well on Windows. If you described the problems we may be able to make XML::Twig work for you too.

    As to other modules, one may ask how long is a piece of string? there are a lot to choose from, for example see this recent node of mine: Re: How to implement XML languages and nodes therein. It does depend on what you want to do as to what is the best solution, in particular I recommend Mirod's Ways to Rome as a useful place to start.

Re: XML::Twig, or something else?
by mirod (Canon) on Jan 20, 2003 at 17:24 UTC
Re: XML::Twig, or something else?
by OM_Zen (Scribe) on Jan 20, 2003 at 17:11 UTC
    Hi ,

    The perl distribution XML::Simple is versatile or you can try XML::SAX

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://228361]
Approved by Mr. Muskrat
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2023-02-09 09:07 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (44 votes). Check out past polls.