klyn.io.xml.dom.XMLNode.replaceChild
method
public replaceChild(newChild as Node, oldChild as Node) as Node throws DOMException
Description

Replaces a child after validating the complete resulting tree. A fragment contributes its children, allowing an empty fragment to remove oldChild.

Parameters
ParameterDescription
newChildReplacement node or fragment.
oldChildChild to remove.
Returns

The removed child.

Throws
  • DOMException for invalid hierarchy, ownership or missing oldChild.
Example

document.replaceChild(document.createElement("new"), document.documentElement)