renameNode: n, namespaceURI, qualifiedName(3)
Allows Element
and
Attr
type nodes to be
renamed. Whenever possible, the nodeName
attribute of the target
Node
is modified directly. If
simply changing the name is not possible, a node is created with
the new name and the child nodes of the old node are moved to the
new node. If the node is an Element
node, renaming it will cause it
to lose the default attributes of the old node name and gain those
corresponding to its new name.
The node to rename.
The namespace URI for the renamed node.
The new qualified name for the node.
Thrown if the target nodeType
is not ELEMENT_NODE
or ATTRIBUTE_NODE
, or if the
implementation does not support renaming the documentElement
.
Thrown if the new qualified name is not a name
according to the contents of the xmlVersion
attribute.
Thrown if an attempt is made to rename a node from a different document.
Raised if the qualifiedName
is malformed or has
a prefix but no namespaceURI
, or if the reserved
xml
namespace prefix was
used incorrectly.