Tomas Studva wrote:
Hi,
I need to implement in Xalan(I am directly woring with Xalan sources) such
method:
input: source doc, XPath expression
output: list or set of nodes used to compute value of expression. The nodes
aren't nodes accessed during expression evaluation, but nodes directly
contributing to result value. In case value of expression is node-set, than
it is what I want. For example /root/child[a=3]/substring(child::text()) , I
want all nodes matched by /root/child[a=3]/child::text() .
/root/child[a=3]/substring(child::text()) is not a legal XPath expression,
because substring() cannot occur as a step.
I need your advice how to implement it. One clever(I think :)) way is to
construct another expression to original expression, which when is evaluated
returns desired result. Maybe I am wrong. Is there any clever way to
implement it, also when I have source code modification access?
I don't think you've fully stated your requirements, so it's hard to say,
but I don't think it will be easy. You certainly should be able to analyze
the expression for all of the location paths, but how you'll decide which
is the result you're interested depends on the requirements.
Dave