System.Xml.XPath.XPathNavigator.InsertBefore Method

Creates a new sibling node before the currently selected node using the XML string specified.

Syntax

public virtual void InsertBefore (string newSibling)

Parameters

newSibling
The XML data string for the new sibling node.

Remarks

To create a new element node, include all XML syntax in the XML string parameter. The string for a new book node is InsertBefore("<book/>"). The string for inserting the text "book" before the current node's text node is InsertBefore("book"). If the XML string contains multiple nodes, all nodes are added.

The following are important notes to consider when using the XPathNavigator.InsertBefore(string) method.

Requirements

Namespace: System.Xml.XPath
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0