Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: XPath matching for object trees

by tomhukins (Curate)
on Feb 11, 2003 at 13:28 UTC ( [id://234393]=note: print w/replies, xml ) Need Help??


in reply to XPath matching for object trees

I like this approach. I find XPath a powerful, simple language and use it often for parsing XML. The idea of using XPath to process tree structures that aren't stored natively as XML interests me.

I wonder if writing your own match() method to implement XPath-like syntax is the best approach, though. Rather than effectively writing another XPath parser, why not serialise your data tree to XML, process it with an existing parser such as XML::LibXML or XML::XPath, then convert the XML back into your initial tree format? That would be slower, but would allow you to reuse existing modules.

The speed issue may be significant for you, but this approach might help other monks with similar problems.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found