Re: Walking the DOM (was: XML APIs)

Stephen,

>THANK YOU!  THANK YOU!  THANK YOU!
>I was beginning to think I was the only one with this opinion.


Many in the WG feels the same as you do so don't lose hope yet.  Patience,
however, is definitely needed.

>firstChild and parentNode, too.


I think firstChild and parentNode can be retained as a absolute view of the
document.  All we need is a sort of 'view' interface to use as the context:

Node parentNode = crazyView.getParentNode(aNode);
Node firstChild = crazyView.getFirstChild(parentNode);

>I would like to see iterators with something like the following interface:
[snip]

Please don't go overboard.  What you are describing is not an iterator but a
rather distasteful but strangely sensible combination of
Iterator/View/Cursor patterns.

A cleaner way to do this is to use something like this:

public interface NodeModel {
    Object getParentNode (Object node);
    ...
    NodeIterator createIterator (Object node);
    NodeView createView (Object context);
    ...
}

Document views can be easily support with this design like this:

public interface NodeView extends NodeModel {
    ...
}

We are too late to do this though...

Best,

Don Park
Docuverse

Received on Tuesday, 3 November 1998 22:30:29 UTC