Re: Browser implementors? Re: [dom3core] getAttribute

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