commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <>
Subject [jxpath] JXPathContext#iterate(String) returns same object multip le times
Date Thu, 05 Jun 2003 09:47:05 GMT
Hi all,

I just noted that both the methods JXPathContext#iterate(String) and
JXPathContext#iteratePointers(String) can return the same object multiple
times if the path (or pointer) to it is different.

In my object graph I have some two-way associations which can cause this
behaviour and that's of course not desirable.  In this scenario
iteratePointers("//b") can end up returning something like:


The two-way associations I have are actually containments comparable to
XML's parent-child relationship between elements.  How can I extend JXPath
to specify what properties in my model are parent relationships?

But regardless of these parent-child relationships I think it's questionable
whether the same object should ever be returned twice by these iterators.
Because it means that the iteration can turn out to be never-ending.  Or
will it even always be indefinite?  But I've probably missed an important
aspect here :-)


View raw message