| CPAN Ratings (Gamma) XML-Parser reviews | |
| Home | Search | About | Login |
RSS | Module Info | Add a review of XML-Parser
3 out of 4 found this review helpful:
I do with there were examples in the documentation (*), but I was able to write a simple parser to do what I needed in about 15 minutes.
The Tree, Subs and Object modules look like they might make my life easier by putting everything into hashes, objects, etc, but they are so negligibly documented that it's just easier to write a Parser as I know what it should do, versus hacking with dumps of data structures to interpret what is going on.
(*) at least as viewed in search.cpan.org, I didn't poke around very much or look closely at the samples subdirectory in the distro (shouldn't it be called "eg"?)
Robert Rothenberg - 2007-01-19 05:28:35
Was this review helpful to you?
Yes
No
Poor installation results on Mac OS X:
t/encoding........"my" variable $p masks earlier declaration in same scope at t/encoding.t l ine 94.
t/encoding........ok
t/external_ent....ok 1/5
501 Protocol scheme 'file' is not supported file:/Users/brian/.cpan/build/XML-Parser-2.34/a. ent
Handler couldn't resolve external entity at line 7, column 5, byte 117
error in processing external entity reference at line 7, column 5, byte 117 at /Users/brian/ .cpan/build/XML-Parser-2.34/blib/lib/XML/Parser.pm line 187
t/external_ent....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-5
Failed 4/5 tests, 20.00% okay
t/file............ok
t/finish..........ok
t/namespaces......ok
t/parament........ok 1/12
501 Protocol scheme 'file' is not supported file:/Users/brian/.cpan/build/XML-Parser-2.34/t/ foo.dtd
Bryce Nesbitt - 2005-12-26 23:59:22
Was this review helpful to you?
Yes
No
XML::Parser was the first decent Perl interface to XML. It links to James Clark's Expat, the original XML-parsing C library, which handles most of the heavy lifting.
XML::Parser uses the event-driven parsing model as opposed to the tree-based model: rather than parsing XML into a big, treelike data structure, with XML::Parser you define event handlers for certain events (like the start of the document, encountering the start of a tag, encountering an XML comment) that get called as those particular events occur.
XML::Parser works; it's quite mature, as is the underlying C library. XML::Parser is very, very fast. XML::Parser is very well documented.
The only gripes I have with XML::Parser are over its API. It appears that a naming convention is non-existant. If there is indeed a naming convention, then it's an extremely confusing one. For example, some methods are named with the first letter of every subsequent word uppercased, like setHandlers(). Most have an underscore separating each world, a la perlstyle, like current_element(), eq_name(), new_ns_prefixes(), or default_current(). Still some have nothing separating words, like parsestring() or parsefile(). The named parameter syntax suffers from similar problems. Maybe this is attributable to the fact that there were two different authors (three if you count Clark himself) or maybe there really is some big, complicated naming convention that makes perfect sense to the current maintainer, but either way I find all of this extremely unintuitive.
As mentioned by another reviewer, the SAX modules are another, more standardized option�one with an API devoid of any of the problems enumerated above. XML::Parser still has much wider distribution, though, and there are many SAX modules to choose from (XML::SAX::PurePerl, XML::Parser::PerlSAX, XML::LibXML::SAX, for example), which is either a very good thing or a very bad thing depending on your preference.
The inertia now in the XML community is definately away from specialized tools like Expat and towards more standardized APIs like SAX.
William G. Davis - 2004-01-25 14:26:55
Was this review helpful to you?
Yes
No
Forget what everyone else says about XML::Parser. Those SAX nuts are just trying to kill it. Use it while you are still able!
Chris Nandor - 2003-08-25 22:20:30
Was this review helpful to you?
Yes
No
This is a good solid module but you should not use it for any new code you are writing.
If you want an event based parser, the SAX API is superior to XML::Parser's API and is supported by a number of different parser libraries - write your code to the SAX API and you can use whichever parser happens to be installed.
If you want a tree style parser then you should look at either XML::Twig (for a strong Perl flavour) or a DOM module with XPath support such as XML::LibXML, XML::XPath or XML::GDOME.
See also the Perl-XML FAQ: http://perl-xml.sourceforge.net/faq/
Grant McLean - 2003-08-18 17:14:37
Was this review helpful to you?
Yes
No
Seems that there is a dependency upon an expat.h file not included in the distribution - suspect it has something to do with the Apache Server.
Steven van Aardt - 2003-08-17 19:31:39
Was this review helpful to you?
Yes
No
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|