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>


"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 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:12 UTC