Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^6: Is there any XML reader like this?

by Jenda (Abbot)
on Jan 15, 2012 at 00:30 UTC ( #947925=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Is there any XML reader like this?
in thread Is there any XML reader like this?

Documentation for the parser? Which one is that if I may ask? perldoc XML::LibXML prints something that definitely doesn't fit a single page and ... doesn't tell me anything of use. perldoc XML::LibXML::Parser doesn't fit on a single page either and ... OK, it explains how I turn the XML into a maze of interconnected objects. It says that I can use it to parse not only XML, but also HTML and SGML and god knows what else. It doesn't say anything about what the heck am I supposed to do with the maze of objects. It doesn't even care to tell me what's the $doc all those tons of methods return. Nada, nil, nothing. So back to the XML::LibXML docs ... OK, XML::LibXML::Document looks promising, perldoc XML::LibXML::Document. 43 methods (if I did not loose count somewhere in the muddle). Maybe more because maybe the object inherits methods from some other but ... no info about that in the docs either ... basically looking at the docs seems the only way to get at the data is to call the ->documentElement() and then ... OK, maybe what I get is a XML::LibXML::Element or something. Or maybe I could call ->getElementsByTagName() but ... "Implements the DOM Level 2 function" now what the fsck is that? You call that documentation?

And XPath? Where's that even just mentioned in the docs? Oh, I see. The start of the description:

This module is an interface to the gnome libxml2 DOM and SAX parser and the DOM tree. It also provides an XML::XPath-like findnodes() interface, providing access to the XPath API in libxml2.
So what docs am I supposed to find and read? If anything I just installed a Perl module XML::LibXML, not some, what was it, gnomio&juliet libxml2. And a XML::XPath-like? How much alike? Where do I find the docs? So am I supposed to use XML::XPath instead or what?

No guys, really, I did look at XML::LibXML a few years ago and tried to learn how to use it, but hey ... I had some work to do, I did not have time to search docs hardly mentioned in these and then other docs and then god only knows what else. Some time later I tried to see what would it take to change XML::Rules to use the universally hailed SAX instead of the good old XML::Parser::Expat, but ... maybe the docs make sense to someone, they did not make any to me.

For someone who had to learn all that XAnythingYouCanThinkOf and DOM nonsense for other languages, the docs of XML::LibXML may contain all info they need. Or at least enough to get them started. For others it's one of the least helpfull documentation found for a Perl module.

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re^6: Is there any XML reader like this?
Re^7: Is there any XML reader like this?
by Anonymous Monk on Jan 15, 2012 at 01:41 UTC

    Hi, you might like XML::LibXML - WHAR HASH TREES WHAR?!

    FWIW, when I want to learn a new package, I skip the SYNOPSIS and go straight for the test suite -- its code that actually runs :)

Re^7: Is there any XML reader like this?
by ikegami (Pope) on Jan 16, 2012 at 06:54 UTC

    perldoc XML::LibXML prints something that definitely doesn't fit a single page and

    uh, the Parser is documented in XML::LibXML::Parser.

    And XPath? Where's that even just mentioned in the docs?

    Are you asking where it's documented that XML::LibXML::Node::findnodes takes an XPath, or are you asking where XPaths are documented in XML::LibXML.

    If the former, XML::LibXML::Node.

    If the latter, your argument is ridiculous. XML::LibXML is no more the place to document XPaths than XML::Simple is the place to document references.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-09-02 03:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (19 votes), past polls