Re: Older Sibling?

John Cowan wrote:
> 
> David Brownell wrote:
> 
> > Perhaps.  If you got used to using it, the linked list implementation
> > would accumulate some bizarre costs since it'd need to recompute that
> > property pretty often ... but that'd be more reasonable than asking for
> > a specific "is this child before that one" primitive, as you'd seemed
> > to be suggesting!
> 
> Furthermore, if the element is part of an entity, then no single index
> will work, as the element node may be in the tree in multiple places.

Actually I tend to disagree on that one.

There is some nasty text in the DOM spec saying that the "same" nodes
are EntityRef children as are children of the respective Entity.  Is
that what you're thinking about?

But that notion of "same" seems to me like it must be (equals? a b)
rather than (eq? a b), to sneak in two LISP primitives ... since, unlike
the case with LISP, DOM nodes have (non-null) ancestors that prevent
them from being in more than one place at a time.  A DOM is a tree,
not a general graph.

(Note to DOM WG:  Perhaps the prose on that part of the DOM spec needs
to say what it means by "same"?)

- Dave

Received on Monday, 28 February 2000 19:25:35 UTC