RE: NamedNodeMap

Allen, Michael B (RSCH) writes:
 > However, I have a new question. Imagine a NodeList is returned by
 > getElementsByTagName. Then a Node in the DOM tree is modified
 > (e.g. replaced, removed, etc). Will these changes be reflected in
 > the NodeList returned by getElementsByTagName? If so this requires

  This is the only interpretation I've ever heard, and I've heard
little but griping about it.  For most purposes, a fairly static
NodeList is sufficient; for NodeList objects used to implement the
childNodes attribute, there's not much of a problem, but the
getElementsByTagName() and getElementsByTagNameNS() return values are
problematic.  My own DOM implementation is non-conforming in this
regard, and I haven't heard any complaints from the users.
  I don't think the liveness requirement is described very carefully;
if I have a node that I remove from the tree, and then add to another
location, should the node be included in any NodeList objects returned
from getElementsByTagName()?  It's still "owned" by the document, and
I may well stick it back in the tree somewhere.  I'm sure this is
covered somewhere, but this kind of thing ends up being a sticking
point for me.


Fred L. Drake, Jr.  <fdrake at>
PythonLabs at Digital Creations

Received on Wednesday, 11 July 2001 16:23:56 UTC