You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mikael Helbo Kjær <mh...@dia.dk> on 2000/03/30 13:59:26 UTC

Callback in XPath searches needed!

Hi all. I`m in a bit of trouble. I`m using the XPath engine of Xalan 1.0,
and it work fine. I`m searching a DOM tree with a pretty simple XPath query,
like this:
	 //parent[name="1"]/parent[name="2"]/target[name="something"]
However now each time I encounter an additional element I need to perform a
callback. 
It goes like this:
             //parent[name="1"]/parent[name="2"]/target[name="something"]
               ^                                                   
               |                                                    
               if node contains the attribute: dbname call a function to do
something
I so need this to happen. I suspect that the NodeCallback interface can help
me, but the documentation is rather non-existent, so I have to ask. When and
how often is a NodeCallback called. Can I get Xalan to help me do this, or
do I have to make my own XPath-like search to do this... I`d rather not :-)

Mikael Helbo Kjær

Software Developer @ DIA a/s