You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mikko Honkala <ho...@tml.hut.fi> on 2003/07/28 14:46:02 UTC

Xalan-J question: using XPathVisitor to get the list of nodes that LocPaths reference

Hi,

for many applications, it is necessary to execute an arbitrary XPath 
expression and return the list of all nodes that the expression 
references in location paths.

For instance, the following expression :
"sum(/doc/item[@level='3']/@value) * /doc/tax/@tax" references value, 
level and tax attributes.

In my application I did this using Xalan-J by extending Compiler and 
WalkerFactory to create my own WalkingIterators in order to get the 
nodes while executing the XPath. This is not very nice, since it depends 
heavily on the version of Xalan.

Would it be possible to implement this using the XPathVisitor class? Is 
it possible to somehow call the visitors while executing the expression 
in order to know correct context for all LocPaths? Or is there another 
way to accomplish this?

-mikko