W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: Walking the DOM (was: XML APIs)

From: Don Park <donpark@quake.net>
Date: Tue, 3 Nov 1998 19:29:26 -0800
Message-ID: <01b501be07a3$54911310$2ee044c6@arcot-main>
To: <www-dom@w3.org>

>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:

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...


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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC