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!

XmlContainer.Replace

Replaces a given child node with another node.

[Visual Basic]
Public Sub Replace( _
   ByVal oldChild As XmlNode, _
   ByVal newChild As XmlNode _
)
[C#]
public void Replace(
   XmlNode oldChild,
   XmlNode newChild
);
[C++]
public: void Replace(
   XmlNode* oldChild,
   XmlNode* newChild
);
[JScript]
public function Replace(
   oldChild : XmlNode,
   newChild : XmlNode
);

Parameters

oldChild
The child node to replace.
newChild
The new child node.

Exceptions

Exception Type Condition
ArgumentException If oldChild is null, if the parent of oldChild is not this element, if newChild is null, if newChild is already parented by another element, or if newChild does not belong to the same XML context as this element.

Remarks

The oldChild node is replaced with the newChild node. The parent of the newChild node must be null before the operation, and the parent of the oldChild node becomes null after the operation.

See Also

XmlContainer Class | XmlContainer Members | System.Xml Namespace