NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlNode.ReplaceChild

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;

Parameters

newChild
The new node to put in the child list.
oldChild
The node being replaced in the list.

Return Value

The node replaced.

Exceptions

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.

Remarks

If the newChild is already in the tree, it is first removed.

See Also

XmlNode Class | XmlNode Members | System.NewXml Namespace