Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^4: The best way to handle different type of XML files (Why I don't think much of XML::Simple)by ikegami (Patriarch) |
on Nov 21, 2009 at 23:14 UTC ( [id://808628]=note: print w/replies, xml ) | Need Help?? |
I don't believe it. Let's compare the parsers by extracting the Person elements from the following very common structure:
The Persons element is optional and the number of Person elements is variable.
Did I pick an example that XML::Simple handles poorly? Let's do another extremely common example to demonstrate otherwise. Let's extract the person's country.
XML::Simple code is insane without a schema. It's much simpler with, but it's still longer and messier than with XML::LibXML. And it takes a lot of up-front time time to create the schema and lots of headaches from making mistakes. With XML::LibXML, I don't have to do any of that up-front extra work XML::Simple requires. so in addition to being a better production parser (simpler, 50x faster, etc), it's a better prototyping parser too.
In Section
Seekers of Perl Wisdom
|
|