W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

RE: NamedNodeMap

From: Allen, Michael B (RSCH) <Michael_B_Allen@ml.com>
Date: Wed, 11 Jul 2001 16:02:04 -0400
Message-ID: <B27EB33BAB29D2119ABF0001FA7EF289053BF064@ewfd04.exchange.ml.com>
To: "'Fred L. Drake, Jr.'" <fdrake@acm.org>, "'www-dom@w3c.org'" <www-dom@w3c.org>
Yes, I've since been informed by others that using members of Node to directly implement the NodeList will not work. I have a separate data structure for this now. It's a little inelegant to perform
the pointer manipulations for each operation twice though; once for the NodeList itself and then again to update the members of Node.

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 active communication between the DOM and any outstanding NodeLists. Is this true? Is there a way to make the view passive so that no
active updating of outstanding NodeLists is required?

Thanks,
Mike

> -----Original Message-----
> From:	Fred L. Drake, Jr. [SMTP:fdrake@acm.org]
> Sent:	Wednesday, July 11, 2001 2:57 PM
> To:	Allen, Michael B (RSCH)
> Cc:	'www-dom@w3c.org'
> Subject:	Re: NamedNodeMap
> 
> 
> Allen, Michael B (RSCH) writes:
>  > Is a NodeNamedMap ever used to hold anything but the Attrs of an
>  > Element?
> 
>   Yes -- they are used to hold the entity and notation definitions in
> the DocumentType node.
> 
>  >          Might an Attr be an entry in more than one
>  > NamedNodeMap?  A simply way to implement NamedNodeMap in
>  > c is to just add nextAttr and previousAtt members to Node and
>  > make NamedNodeMap a struct like:
> ...
>  > If the answers to the above questions are "no" I don't see a problem
>  > with this technique. Do you?
> 
>   I don't think Attr nodes can appear in more than one map.
> Whether or not this is a reasonable implementation approach depends
> on how you handle default attributes derived from the DTD; if you
> support a DTD, this may not be a good approach, especially if you
> support DOM mutation.
>   (And yes, I think mutation should be a separate feature from simple
> read-access!  But that's a different topic.)
> 
> 
>   -Fred
> 
> -- 
> Fred L. Drake, Jr.  <fdrake at acm.org>
> PythonLabs at Digital Creations
> 
Received on Wednesday, 11 July 2001 16:02:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:49 GMT