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

Re: Regarding setNamedItem!!!

From: Ray Whitmer <rayw@netscape.com>
Date: Tue, 16 Oct 2001 07:15:37 -0700
Message-ID: <3BCC4109.2080300@netscape.com>
To: Thara S <s_thara@rti.daimlerchrysler.com>
CC: www-dom-ts@w3.org
Any level 2 parser should call level 2 methods, hence it should call 
setNamedItemNS in preference to setNamedItem.  Otherwise, it would not 
properly detect namespace non-well-formedness problems that come from a 
document that cannot be represented in terms of level 2 DOM, i.e. where 
two attributes have the same prefix which map to the same namespaceURI, 
which can be detected by testing for a non-null return from setNamedItemNS.

Ray Whitmer
rayw@netscape.com

Thara S wrote:

>  
>
> Hi!!!,
>
>  
>
> Could someone help me out on this tooooo!!!
>
>  
>
> When I have both DOM Level 1 and level 2 methods implemented, to 
> implement a parse function which parses an input XML file,what kind of 
> checking  should
>  I make to choose an appropriate method from level 1 or level 2 (the 
> one with namespaces). For example, in the input XML FILE, when I 
> encounter an attribute node of an element, how do I know whether 
> setNamedItem or setNamedItemNS should be called?
>
>  
>
> thanx in advance,
>
>  
>
> regards
>
> Thara
>
Received on Tuesday, 16 October 2001 11:59:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:58:45 GMT