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

Re: XML::Simple giving a non-specific error

by crashtest (Curate)
on Mar 12, 2010 at 00:31 UTC ( #828172=note: print w/ replies, xml ) Need Help??


in reply to XML::Simple giving a non-specific error

Should I be using a different module?
I've been told: yes.

I recently recommended XML::Simple in another thread, only to have Your Mother strongly advise against it. I haven't had a chance to use XML::LibXML, XML::Twig and their ilk, so I can't comment on their quality. I have used both XML::Parser and XML::Simple, and can attest that I don't really like them - it's mostly the API I find clunky, although I can't complain about bugs or crashes.

What I can say is that the next time I embark on an XML project, I'll be taking Your Mother's advice and looking into the more modern alternatives on CPAN.

Some food for thought.


Comment on Re: XML::Simple giving a non-specific error
Re^2: XML::Simple giving a non-specific error [OT: Twig]
by toolic (Chancellor) on Mar 12, 2010 at 02:43 UTC
    That is a good plan, crashtest. For general-purpose parsing, I recommend XML::Twig for the combination of the following reasons:
    • The API is superior to the others you have tried, offering method calls and xpaths.
    • The extended documentation is fairly easy to follow, well-organized and comprehensive.
    • The tutorial is easy to complete and extremely useful.
    • The author is a PerlMonk and offers prompt support here at the Monastery.
    I started out with XML::Parser and stuck with it for a while because I didn't even know others existed. A collegue made me aware of XML::Simple, but I have never used it because it is too limited for the XML I have.

    When I discovered the CPAN Recommended Modules website, I tried using XML::LibXML, but I quickly became flustered. Then, I tried XML::Twig, and I haven't needed anything else since.

    I marked this node as OT because it has nothing to do with solving the OP's specific problem regarding getting a parser to return more useful diagnostic messages.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828172]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-12-22 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls