Re: Hello and NodeIterator Revisited

Craig,

>I really like the way you put the ContainerIterator into the Node to
>model the "betweeness".  But instead of putting the NodeIterator into
>the ContainerNode, put a "point" into the list.  And then give that
>"point" to the NodeIterator.  Then you no longer have a reference in
>the ContainerNode to the NodeIterator so it can go out of scope now
>when the user is done with it and in the destructor you can tell it to
>remove it's "point" from the ContainerNode.  Then the NodeIterator just
>uses that "point" the same way it used itself previously to navigate
>within it's parent ContainerNode.  Of course, this just moves the
>issue of "release" into another object behind the scenes.  Does this
>not allow you to get rid of "release" in the NodeIterator interface?
>I have not implemented this, I could be missing something.

I can't believe I let the marker technique slip my mind.  I need to play
more Golf.

I didn't want to admit defeat without solid evidence so I went ahead and
implemented it.  It did work wonderfully.  Thanks for the reminder.  One
thing that disturbed me was how often the NodeIterator is being created and
destroyed just for a simple XML file.  It seems that TreeIterator should be
used as often as possible to cut down on NodeIterator instances.

BTW, I rewrote SAXDOM while I was at it (crazy things happen when I can't
sleep) and renamed it to FREE-DOM so the new stuff is inside the FREE-DOM
0.2alpha version which can be found at:

http://www.docuverse.com/personal/freedom/index.html


FREE-DOM means Free DOM implementation.  FREE-DOM supports but is not
limited to SAX.  Look for AElfred and MSXML support in the near future with
expanded DOM spec support (meaning XML and HTML portion of the spec).

Regards,

Don Park
http://www.docuverse.com/personal/index.html

Received on Tuesday, 5 May 1998 12:25:34 UTC