I ran into some memory limitations whilst using XML::LibXML. A 265MB sized document would take about 2GB of memory which wasn't what I had available, nor did I want my program to take up that much memory.
I was able to quickly switch to XML::Twig and doing so was a joy. Memory usage has gone down to 40MB. At a later point it turned out to be about 90MB. Even so, a HUGE improvement.
The documentation was easy enough to follow, although it would be nice if all the methods were available in the document index. Using this module makes using XML a lot easier. I'll probably be using this module for all my future XML parsing needs.
XML::Twig is truly a blessing. It has been by my side through many XMLs and even a messy HTML that was difficult (for me, at least) in HTML::TreeBuilder/Element. The author has been responsive and informative in times of trouble, and the accompanying website (www.xmltwig.com) provides supplementary examples and FAQs.
This is the first XML module that makes me want to work with XML and related formats in Perl. It parses large documents in linear time as promised and provides a simple, yet incredibly powerful interface. XML::Twig is significant achievement - as almost everything else on CPAN for parsing XML goofs the performance / interface complexity trade-off. Highly recommended.
I rarely give a distribution a full 5 rating across the board, but rarely is a tool so useful and well made as XML::Twig. This module is indispensable for ripping apart XML, particularly when dealing with extremely large XML files.
It makes processing XML a nearly tolerable process (I mean, it's still XML after all). So, whether you need to translate your XML from one format to another, or just iterate over pieces of tags to perform an action, I'd highly recommend this module.
A few weeks ago I was playing with some large XML files and thought I'd learn how SAX worked. I wrote some code to keep track of whereabouts in the tree I was and process what I found. But my code looked messy: what I really wanted was something that would give me small chunks of the document to operate on; not something where I had to keep track of my position in the document.
This reminded me of XML::Twig, which I've used in the past. Whereas SAX handlers perform an action on encountering certain features in a document, XML::Twig returns fragments of the document tree that you can interrogate or mainpulate. You can operate on the twigs, the small parts of the document tree, using an intuitive syntax or use XPath.
I've used this module for both complex and simple XML processing and it does the job better than anything else I've found. When I encountered a bug in the module, the author released a fixed version within a few days of me logging a failing test in RT. Impressive!
I like your module! Thanx alot, I have just been getting bored of using XML::SAX, and now I've found the perlish way for XML, and it's XML::Twig; I don't use it widely, but first sample I tried to run, just copy-pasted from doc gave me a cool results;
This is a great module, that I have been using extensively for several years. It is very reliable, a great way to manage lots of XML through Perl reliably.
Once in a while, I have had a mysterious error - I think most or all of these are because XML::Twig is built on top of a more basic XML module that is returning these errors. But it has not been a major problem.
There are a few more utility funcions I would like, such as an unwrap method. (I subsequently realized that the erase() method is that very thing--I think unwrap() would be a better name. ;-)
Honestly, Perl + XML::Twig is a much faster way to transform lots of XML quickly than using XSLT.