- From: Allen, Michael B (RSCH) <Michael_B_Allen@ml.com>
- Date: Wed, 11 Jul 2001 16:45:26 -0400
- To: "'Fred L. Drake, Jr.'" <fdrake@acm.org>
- cc: www-dom@w3c.org
Ok, I'm glad I'm not the only one that is confused by this. The only way to implement this functionality verbatium that I can see would be to have an active NodeLists table for each Node. If a Node is selected for inclusion in a NodeList a pointer to that list is saved in a list of NodeLists that reference this Node. Then, at any time, if that Node is modified, replaced, removed, etc the appropriate action is performed on all active NodeLists for that Node. The table could be a hashtable member of Document. Whenever a node is freed the table entry is removed (after all it's NodeLists are updated of course). I beleive it could be done in an efficient manner actually. I think I'll get the basics working first. Thanks for your help, Mike > -----Original Message----- > From: Fred L. Drake, Jr. [SMTP:fdrake@acm.org] > > 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 > > -- > Fred L. Drake, Jr. <fdrake at acm.org> > PythonLabs at Digital Creations >
Received on Wednesday, 11 July 2001 16:45:31 UTC