W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1998


From: Werner Donne' <wdonne@ibm.net>
Date: Tue, 20 Jan 1998 14:34:33 +0100
Message-Id: <34C4A7E8.258AB907@ibm.net>
To: www-dom@w3.org
Good day,

I would like to present a few remarks regarding the working draft of 9
December 1997 of the DOM Core Level1 specification.

There seem to be three ways to iterate over the children of a Node
object. First
there are functions in the Node interface itself like getFirstChild etc.
second way is using Node.getChildren and continuing with the NodeList
which has the item and getLength functions. The NodeList.getEnumerator
access to the third iteration fashion. Wouldn't it be simpler to just
the function Node.getEnumerator and use the resulting interface?

The function Node.getChildren returns null if there are no children. I
this should return an empty NodeList to avoid introducing a special
case. A
call to Node.getChildren is normally followed with a loop that drives
iteration. Such a loop is capable of iterating over all sets and thus
empty ones. The null introduces redundant control flow in the form of an

There are two ways to modify the set of children of a Node. Again there
functions in the Node interface itself. The second way is by using the
EditableNodeList interface. However, I can't seem to find any function
in the
Core specification that returns such a list, which leaves me to think a
check must be performed on the result of Node.getChildren. The latter is
not a
problem of course. I suggest to provide only an EditableNodeEnumerator
interface that is derived from the NodeEnumerator interface.

The fact that Node.NodeType is an enumeration of type constants defined
by the
Node interface can break code in the future. When types are added
clients of
the Node interface are affected. It would be better in my opinion that
derivatives of Node provide a symbolic constant that is returned by
version of Node.getNodeType. You can of course leave it to the CORBA
type checking functions as is suggested for the EditableNodeList
interface (I

With kind regards,

Werner Donne'
Leuvenselaan 172
B-3300 Tienen
tel: (+32) 16 810203
fax: (+32) 16 820826
E-mail: wdonne@ibm.net
Received on Tuesday, 20 January 1998 08:42:32 UTC

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