Iterators and removing

Hi,

I've got a question on the behaviour of NodeIterators.  What is supposed to
happen if the current node of an iterator is removed from its parent?

The method toNext() of NodeIterator is defined as follows:

   This method alters the internal state of the iterator such that the node it
   references is the next in the sequence the iterator is presenting relative
   to the current position.

But now the node is no longer part of the sequence represented by the iterator.
This case actually occurs if you want to conditionally remove the children of
some node.

It gets even more confusing if you reinsert the node at a different position as
a child of the same parent: Does the Iterator move along with its node?  Or
what if you insert it as a child of an entirely different parent?

Enlightment appreciated,
	Axel

----------------------------------------------------------------------
+ Axel Rasmus	  "A man that cannot walk has to fly"     Wienberg +

Received on Thursday, 2 April 1998 06:24:45 UTC