[Fwd: TreeIterator]

I have the impression my earlier submission failed. Sorry if you get it
twice anyway.
-- 
Werner Donné
Re BVBA
Leuvenselaan 172
B-3300 Tienen
tel: (+32) 16 810203
fax: (+32) 16 820826
E-mail: wdonne@ibm.net

Forwarded message 1

  • From: (wrong string) é <wdonne@ibm.net>
  • Date: Mon, 20 Apr 1998 14:32:56 +0200
  • Subject: TreeIterator
  • To: DOM <www-dom@w3.org>
  • Message-ID: <353B4078.5E4F@ibm.net>
Hi

There is a problem with TreeIterator being derived from NodeIterator.
A TreeIterator is initialized with a node. Because it is a NodeIterator,
the
inherited operations talk about the children of the initialization node.
That
means the TreeIterator operations numChildren, toFirstChild, toLastChild
and
toNthChild have no meaning. The NodeIterator operations getLength,
toFirstNode,
toLastNode and moveTo provide the intended meaning respectively.

If this interpretation is wrong then the TreeIterator is a NodeIterator
over
the children of the parent node of the initialization node, that happens
to be
positioned at the initialization node. In that case the operations
toPreviousSibling and toNextSibling have no meaning. The NodeIterator
operations toPrevNode and toNextNode provide the intended meaning
respectively.

In any case, the additional operations should have the same, new,
semantics
regarding iterator position the inherited operations have.

If TreeIterator must inherit from NodeIterator the only additional
operations
that are needed in it are "up" and "down". These add tree navigation to
a
NodeIterator. The up operation is what toParent is now. The down
operation goes
one level deeper through the node the iterator is now positioned in
front of.
The new state of the iterator is the same as if it were initialized with
the
node the iterator was positioned in front of in the old state.

Regards,
-- 
Werner Donné
Re BVBA
Leuvenselaan 172
B-3300 Tienen
tel: (+32) 16 810203
fax: (+32) 16 820826
E-mail: wdonne@ibm.net

Received on Tuesday, 21 April 1998 06:03:25 UTC