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/04/06 10:41:48 UTC
RE: Callback in XPath searches needed!
Hi all.
Scott. I know I might be asking a stupid question, but what do you mean by
depth-first searches, what differenciates the XPath queries to do this and
any other XPath query? I`ve been looking at the findChildren method in
SimpleNodeLocator, and although some of it seems to me like voodoo (I
haven`t got time to sort through every method call). I pretty sure that, if
I can get the NodeCallback to execute on every node my problems are that
much smaller. However I don`t know how to do this, as I also still need the
basic XPath functionality present right now. Does anybody have any ideas?
Mikael Helbo Kjær
Software Developer @ DIA a/s
-----Original message-----
From: Scott Boag/CAM/Lotus [mailto:Scott_Boag@lotus.com]
Sent: 30. marts 2000 17:44
To: xalan-dev@xml.apache.org
Subject: Re: Callback in XPath searches needed!
NodeCallback is only used, at this time, in the case of depth-first
searches, which only happen right now with fairly simple expressions. I
think you need to derive from SimpleNodeLocator, and probably augment the
findChildren function. The easiest way right now to install your derived
locator is to use a derived version of the XMLParserLiaison you are using
and override createXLocatorHandler().
-scott
Mikael Helbo
Kjær To:
"'xalan-dev@xml.apache.org'" <xa...@xml.apache.org>
<mh...@dia.dk> cc: (bcc: Scott Boag/CAM/Lotus)
Subject: Callback in XPath
searches needed!
03/30/2000
06:59 AM
Please
respond to
xalan-dev
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