Name
setAttributeNodeNS: newAttr(2)
Synopsis
Sets or replaces the attribute in the element’s
attributes
collection that
matches the namespace URI and the given Attr
object’s local name. This operation
is identical to the setAttributeNode
method, except that it
considers namespace differences between attributes. If an Attr
object with the given name in the
attributes
collection already
exists, this method returns a reference to the old Attr
object; otherwise, it returns
null
.
Argument
- newAttr: Attr
The new
Attr
object to set.
Exceptions
- WRONG_DOCUMENT_ERR
Raised if the
newAttr
node was created in a different document than the parent node.- NO_MODIFICATION_ALLOWED_ERR
Raised if the new parent node is read-only.
- INUSE_ATTRIBUTE_ERR
Raised if another
Element
already uses thenewAttr
node. Each element must have a uniqueAttr
object.
Java binding
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException;
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.