You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Psi Aushilfe3 <Au...@prosieben.de> on 2003/08/08 13:36:22 UTC

[JXPath] Cannot create a relative context for a non-existent node

Hi!

	...
	JXPathContext xrole =
xnode.getRelativeContext((Pointer)iter.next());

xrole is ok and I can work with it.

	Pointer       person  =
xrole.getPointer("childNodes[packetTypeId=$id]/nodeElement");
	JXPathContext xperson = xrole.getRelativeContext(person);

Person ist not null but person.getNode() is (?) and therefore xperson
does throw an exception, but the following works:

	
System.out.println((String)xrole.getValue("childNodes[packetTypeId=$id]/
nodeElement"));

Note that both xpath expression are identical and the only difference is
getRelativeContext(getPointer()).

What am I doing wrong??