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.InsertBefore

Inserts the specified node immediately before the specified reference node.

[Visual Basic]
Overridable Public Function InsertBefore( _
   ByVal newChild As XmlNode, _
   ByVal refChild As XmlNode _
) As XmlNode
[C#]
public virtual XmlNode InsertBefore(
   XmlNode newChild,
   XmlNode refChild
);
[C++]
public: virtual XmlNode* InsertBefore(
   XmlNode* newChild,
   XmlNode* refChild
);
[JScript]
public function InsertBefore(
   newChild : XmlNode,
   refChild : XmlNode
) : XmlNode;

Parameters

newChild
XmlNode to insert.
refChild
XmlNode that is the reference node. The newNode is placed before the refNode.

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 insert 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 refChild is not a child of this node.

Remarks

If refChild is null, insert newChild at the end of the list of children. If newChild is a XmlDocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

See Also

XmlNode Class | XmlNode Members | System.NewXml Namespace