ReplaceChild()

XmlNode::ReplaceChild(SharedPtr<XmlNode>, SharedPtr<XmlNode>) method

Replaces the child node oldChild with newChild node.

virtual SharedPtr<XmlNode> System::Xml::XmlNode::ReplaceChild(SharedPtr<XmlNode> newChild, SharedPtr<XmlNode> oldChild)

Arguments

ParameterTypeDescription
newChildSharedPtr<XmlNode>The new node to put in the child list.
oldChildSharedPtr<XmlNode>The node being replaced in the list.

Return Value

The node replaced.

Exceptions

ExceptionDescription
InvalidOperationExceptionThis node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node.
ArgumentExceptionThe newChild was created from a different document than the one that created this node. This node is read-only. The oldChild is not a child of this node.

See Also