Replaces the child node oldChild with newChild node.
[Visual Basic] Overridable Public Function ReplaceChild( _ ByVal newChild As XmlNode, _ ByVal oldChild As XmlNode _ ) As XmlNode [C#] public virtual XmlNode ReplaceChild( XmlNode newChild, XmlNode oldChild ); [C++] public: virtual XmlNode* ReplaceChild( XmlNode* newChild, XmlNode* oldChild ); [JScript] public function ReplaceChild( newChild : XmlNode, oldChild : XmlNode ) : XmlNode;
The node replaced.
Exception Type | Condition |
---|---|
HIERARCHY_REQUEST_ERR | This node is of a type that does not allow children of the type of the newChild node. Or the node to put in is one of this node's ancestors. |
WRONG_DOCUMENT_ERR | The newChild was created from a different document than the one that created this node. |
NO_MODIFICATION_ALLOWED_ERR | This node is read-only. |
NOT_FOUND_ERR | The oldChild is not a child of this node. |
If the newChild is already in the tree, it is first removed.