Why is there no removeAttributeNodeNS method?
Answer:
There is, but it's called removeAttributeNode.
We needed both setAttributeNode and setAttributeNodeNS, because those functions use different rules to select which (if any) existing Attr the new one will replace. setAttributeNode bases this decision on the nodeName, while setAttributeNodeNS looks at the combination of namespaceURI and localname. However, when you remove a specific AttrNode, its nodeName, localname, and namespaceURI are ignored, and there's no need for a second method to support this.
No comments:
Post a Comment