Found a solution to this issue, using relative contexts:
JXPathContext ctx = JXPathContext.newContext(/* get the List<State> here
*/);
JXPathContext relativeCtx;
Iterator<Pointer> it = (Iterator<Pointer>)
ctx.iteratePointers("[EMAIL PROTECTED] = " + countryId + "]");
while (it.hasNext()) {
relativeCtx = ctx.getRelativeContext(it.next());
State aState = (State) relativeCtx.getValue("..");
// Do something with the State
}
No more *org.apache.commons.jxpath.JXPathException: Cannot compare
pointers that do not belong to the same tree: '/.[2]' and '/.[1]'*
exception.
Nicolas Laplante wrote:
Tried with the expression you provided below, I got the same exception.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]