|
next
|
Subject: XPath parser in Java Author: Klarinda GW Date: 10 Oct 2006 12:52 AM Originally Posted: 09 Oct 2006 05:17 AM
|
Hi,
Is there any XPath parser written in java?
But I do not want the XPath parser to evaluate the XPath expression
and return the XML nodes (I don't want the XPath parser to query the
XML document). Rather, I want the XPath parser to return an array or a
list or tree or anything where I can traverse step by step.
I am looking for something like this:
xpath = XPathParser.parse("/a/b[P and Q]/following::*[2]");
xpath.step(1) will return axis = child, NameTest = a
xpath.step(2) will return axis = child, NameTest = b, predicate = P and Q
predicate can further be divided into predicate.part(1) = P,
predicate.part(2) = Q, predicate.boolean() = and
(P and Q can be something such as xyz = 'some value' or XPath function)
xpath.step(3) will return axis = following, NameTest = *, predicate = 2
Thanks,
Klarinda
|
|
|