W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

Re: Regarding NameNodeMap!!!

From: Ray Whitmer <rayw@netscape.com>
Date: Tue, 16 Oct 2001 07:09:00 -0700
Message-ID: <3BCC3F7C.1040208@netscape.com>
To: Thara S <s_thara@rti.daimlerchrysler.com>
CC: www-dom@w3.org
It depends upon whether a level 1 or a level 2 method is called.  For 
level 1 methods, the qualified name is used.  For level 2 methods, the 
localName ane namespaceURI.

This means that, depending upon whether a level 1 or a level 1 method 
was called, a different node may be replaced when setting an attribute.

This is why it is important that after the document is created in 
normalized form where both the qualified name and the 
localName/namespaceURI is unique (usually by a parser) you should only 
use level 1 or level 2 methods in your application -- not both as some 
people try to keep suggesting.  This means that if you ever use 
namespaces, you should never use level 1 methods which have been 
superseded, even for those things which do not have a namespace. 
 Instead you should use level 2 methods passing a null namespaceURI if 
there is no namespace.

Ray Whitmer
rayw@netscape.com

Thara S wrote:

> Hi !!
>
>  
>
> Here's my query!!! ........Can somebody help me out on this.......???
>
>  
>
> In DOM specification, an element's NamedNodeMap contains its attribute 
> nodes. In DOM level 1,we use setNamedItem to retrieve a node from 
> NamedNodeMap by its name. In DOM level 2 the setNamedItemNS method is 
> used...,
>
>  
>
> I wanted to know ....What should be the lookup key used to retrieve 
> from NamedNodeMap? Is it qualifiedName (two-part name containing 
> prefix and localName) or two-part name containing localName and 
> namespaceURI?
>
>  
>
> thanx in advance,
>
>  
>
> regards
>
> Thara
>
Received on Tuesday, 16 October 2001 12:56:11 GMT

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