Re: Regarding NameNodeMap!!!

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 UTC