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

Re: Browser implementors? Re: [dom3core] getAttribute

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Fri, 2 Dec 2005 17:26:11 -0500
To: "DOM mailing list" <www-dom@w3.org>
Message-ID: <OF280C2AE4.150CBB04-ON852570CB.0079D511-852570CB.007B3F84@us.ibm.com>

(http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#Namespaces-Considerations)



"Note: DOM Level 1 methods are namespace ignorant. Therefore, while it is
safe to use these methods when not dealing with namespaces, using them and
the new ones at the same time should be avoided. DOM Level 1 methods solely
identify attribute nodes by their nodeName. On the contrary, the DOM Level
2 methods related to namespaces, identify attribute nodes by their
namespaceURI and localName. Because of this fundamental difference, mixing
both sets of methods can lead to unpredictable results. In particular,
using setAttributeNS, an element may have two attributes (or more) that
have the same nodeName, but different namespaceURIs. Calling getAttribute
with that nodeName could then return any of those attributes. The result
depends on the implementation. Similarly, using setAttributeNode, one can
set two attributes (or more) that have different nodeNames but the same
prefix and namespaceURI. In this case getAttributeNodeNS will return either
attribute, in an implementation dependent manner. The only guarantee in
such cases is that all methods that access a named item by its nodeName
will access the same item, and all methods which access a node by its URI
and local name will access the same node. For instance, setAttribute and
setAttributeNS affect the node that getAttribute and getAttributeNS,
respectively, return."


(See also  http://www.w3.org/DOM/faq.html#removeAttributeNodeNS)

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk
Received on Friday, 2 December 2005 22:37:02 GMT

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