You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Christian Geuer-Pollmann <ma...@nue.et-inf.uni-siegen.de> on 2002/05/29 11:25:55 UTC

Re: Problem with XPathAPI.eval(contextNode, pattern)


--On Mittwoch, 29. Mai 2002 11:26 +0200 
Daniela.D.Schilling@daimlerchrysler.com wrote:

> Hello,
>
> I've got a problem with the method eval in XPathAPI.
> The documentation of this method says that the parameter contextNode is
> the  node where the search starts from.
> Entering the document node the method works fine, but when I enter
> another node  the search still starts with the root node.
> I would be pleased if someone could tell me if I use this method in a
> wrong way  and if yes what I am doing wrong or if there is a mistake in
> the API.

printNodes(XPathAPI.eval(curNode, "//Linux").nodelist());
printNodes(XPathAPI.eval(curNode, "/PC/IDECard/HardDisc").nodelist());

The search starts at the root node because your XPathes enforce that:

//Linux
/PC/IDECard/HardDisc

Maybe you want to try

.//Linux
./PC/IDECard/HardDisc

instead.

Regards,
Christian