[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re:question: NodeIterator in DOM

  • From: akitoshi.yoshida@s... (Akitoshi Yoshida)
  • To: xml-dev@i...
  • Date: Fri, 15 May 1998 17:19:56 +0200 (METDST)

Another question regarding NodeIterator:
You have an NodeIterator instance with the iterator
position set somewhere in the middle. When you
remove three nodes: first, the node just after the
iterator position, second the node after this removed
node, and finally the node just before
the original iterator position,
then what should toNextNode() and toPrevNode() return?

in example:
we have nodes A B C D E.
the iterator is positioned just before C.
remove C, D, and B.
then we have A E and the iterator position should be
positioned just before E.
so toNextNode() and toPrevNode() should return E and A, respectively.

NodeIterator may mark its current iterator position by
an integer offset or by an object reference. but it must
be notified for certain insert and remove operations to
preserve the above semantics. Is it correct?


---- original message
I have a question on NodeIterator in DOM-19980416.

Excerpt from the spec:

  If a node is inserted before the node just after
  the iterator position, it will be returned by getNextNode();
  likewise if a node is inserted after the node just previous
  to the iterator position, it will be return by the next
  getPrevNode() call.

The first part is clear. When a Node is inserted by insertBefore()
at the node just before the iterator position, the iterator position
is set in front of this new node. The second part
starting "likewise.." is not clear to me.  Are we assuming the
existance of the insertAfter() method? It sounds like the
insertion position (relative to the nodes) is the same as
in the first case. If we only have the
insertBefore() method in the Node inteface,
how can we distinguish the above two cases?

thanks in advance for any clarification


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.