Re: The mostly used xml parser
by GrandFather (Saint) on Oct 05, 2005 at 08:16 UTC
|
If XML::Simple does the job for you, use it. It is widely used and for simple applications won't go out of fashion in a hurry.
If you need more power then take a look at XML::twig, especially if you are filtering XML, or perhaps XML::TreeBuilder if you want to move elements around.
Perl is Huffman encoded by design.
| [reply] [Watch: Dir/Any] |
|
I've not found anything XML::Twig couldn't do. Including moving elements around. ;-) In fact, I use XML::Twig to manipulate HTML tables to "automatically" re-insert the header of the table every x rows (so you don't need to scroll too far to see the header info), and to change the class for each row (tr element) to alternate so that CSS can come by and change the background colour to make it again easier to follow with the eye.
Perhaps XML::TreeBuilder would be easier for this. I'm not sure. Maybe XML::Twig is just my metaphorical hammer, and all XML problems seem to be nails to me. Or perhaps XML::Twig is the swiss-army-knife of XML processors, and I chose well. Up to you to decide. ;-)
| [reply] [Watch: Dir/Any] |
|
A month ago I'd not have mentioned XML::Twig - XML/HTML::TreeBuilder was my hammer. Having seen mention of XML::Twig] so frequently I've started using it too and it does do filtering (my first application for it) very nicely!
What I'd like would be an HTML::Twig. Might not be as "easy" to write though :).
Perl is Huffman encoded by design.
| [reply] [Watch: Dir/Any] |
|
|
|
Re: The mostly used xml parser
by derby (Abbot) on Oct 05, 2005 at 10:42 UTC
|
| [reply] [Watch: Dir/Any] |
|
Yes! It seems that XML::LibXML::SAX is good for me, because I think about wide usage of whole XML::LibXML in my project, so I will not add dependencies...
| [reply] [Watch: Dir/Any] |
|
Agreed. By far the best XML module suite to date. Full-featured, devilishly fast and very frugal with the memory. Particularly the last part is kind of a killer criterion when you're twiddling XML using Perl.
Makeshifts last the longest.
| [reply] [Watch: Dir/Any] |
Re: The mostly used xml parser
by scollyer (Sexton) on Oct 05, 2005 at 09:50 UTC
|
It's not "mostly used" but if you need an XML parser with good support for XML Schema, you could take a look at XML::Xerces which provides Perl bindings to the Apache Xerces XML implementation.
One downside of this is that the developer is unlikely to be maintaining it for support of newer versions of Xerces (currently XML::Xerces supports Xerces 2.6.0, and Xerces 2.7.0 is available, with 3.0.0 being planned.
The advantage is that Xerces is a very complete SAX2/DOM/XML Schema implementation with good support and wide usage.
Steve Collyer | [reply] [Watch: Dir/Any] |