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

Re: question: NodeIterator in DOM

  • From: Tyler Baker <tyler@i...>
  • To: Akitoshi Yoshida <akitoshi.yoshida@s...>
  • Date: Mon, 18 May 1998 08:34:10 -0400

Akitoshi Yoshida wrote:

> Hi,
> 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?

Essentially a similiar problem occurs in the JDK 1.2 Collection classes.  What
JavaSoft suggests is that for all Iterators (a new interface in the JDK 1.2
Collection classes) you synchronize on the object being iterated so that no
internal changes to the object's state are made while iterating.  Since DOM is
supposed to be architectural and language neutral, languages which lack
synchronization support may find some difficulty in making sure that an object
which returns an Iterator object is not mutated while iteration is occurring in a
multithreaded environment.  If your application is single threaded, you should
not have to worry about your object (such as a List) that returns the Iterator
object being mutated except for programming error where you add and remove
objects to the object returning the Iterator object while iterating.  Sorry to be
so convoluted here but I got 3 hours of sleep last night so I hope the above made


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.