Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: XPath matching for object trees

by tomhukins (Curate)
on Feb 11, 2003 at 13:28 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2021-01-23 20:38 GMT
Find Nodes?
    Voting Booth?