Method ReplaceChild
- Namespace
- SharpVectors.Dom
- Assembly
- SharpVectors.Core.dll
ReplaceChild(XmlNode, XmlNode)
Replaces the child node oldChild
with newChild
in the list of children, and returns the oldChild
node.
XmlNode ReplaceChild(XmlNode newChild, XmlNode oldChild)
Parameters
newChild
XmlNodenew node to put in the child list.
oldChild
XmlNodenode being replaced in the list.
Returns
- XmlNode
The node replaced.
Remarks
If newChild
is a IDocumentFragment object, oldChild
is replaced by all of the IDocumentFragment children, which are inserted in the
same order. If the newChild
is already in the tree, it is first removed.
Exceptions
- DomException
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the
newChild
node, or if the node to put in is one of this node's ancestors.WRONG_DOCUMENT_ERR: Raised if
newChild
was created from a different document than the one that created this node.NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of the new node is readonly.
NOT_FOUND_ERR: Raised if
oldChild
is not a child of this node.