Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: A sane method for parsing deeply nested XML

by sundialsvc4 (Monsignor)
on Mar 13, 2013 at 14:40 UTC ( #1023214=note: print w/ replies, xml ) Need Help??


in reply to A sane method for parsing deeply nested XML

Another, more-general solution is to use XPath expressions, as implemented by some of the packages such as XML::LibXML.   (This particular package invokes an industry-standard C library for handling XML.)

The advantage of this approach is that the expression describes what you want to retrieve, and it’s up to the library to give you the result.   The structure of your application logic no longer has to match the structure of the XML ... sort of like the difference between a hand-crafted recursive descent compiler vs. using a grammar system like YACC.   If your XML is complicated, deeply-nested, variable and so forth, then that’s what is “sane” to me.


Comment on Re: A sane method for parsing deeply nested XML

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-07-23 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls