Creates a new child node at the beginning of the list of child nodes of the current node using the nodes in the System.Xml.XPath.XPathNavigator object specified.
- newChild
- An System.Xml.XPath.XPathNavigator object positioned on the node to add as the new child node.
Prepending a child node adds the new node to the beginning of the list of child nodes for the current node. For example, when three child nodes exist for an element, the prepended node becomes the first child node. If no child nodes exist, then a new child node is created.
The following are important notes to consider when using the XPathNavigator.PrependChild(XPathNavigator) method.
If the System.Xml.XPath.XPathNavigator object is positioned over a sequence of XML nodes, all the nodes in the sequence are added.
The XPathNavigator.PrependChild(XPathNavigator) method is valid only when the System.Xml.XPath.XPathNavigator is positioned on an element node.
The XPathNavigator.PrependChild(XPathNavigator) method does not affect the position of the System.Xml.XPath.XPathNavigator.