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:

        /a[1]/b[1]
        /a[1]/b[1]/a/b[1]
        /a[1]/b[1]/a/[b[1]/a/b[1]
        ...

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 :-)

--
knut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to