InsertBefore()

XPathNavigator::InsertBefore() method

Returns an XmlWriter object used to create a new sibling node before the currently selected node.

virtual SharedPtr<XmlWriter> System::Xml::XPath::XPathNavigator::InsertBefore()

Return Value

An XmlWriter object used to create a new sibling node before the currently selected node.

Exceptions

ExceptionDescription
InvalidOperationExceptionThe position of the XPathNavigator does not allow a new sibling node to be inserted before the current node.
NotSupportedExceptionThe XPathNavigator does not support editing.

XPathNavigator::InsertBefore(String) method

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

virtual void System::Xml::XPath::XPathNavigator::InsertBefore(String newSibling)

Arguments

ParameterTypeDescription
newSiblingStringThe XML data string for the new sibling node.

Exceptions

ExceptionDescription
ArgumentNullExceptionThe XML string parameter is nullptr.
InvalidOperationExceptionThe position of the XPathNavigator does not allow a new sibling node to be inserted before the current node.
NotSupportedExceptionThe XPathNavigator does not support editing.
XmlExceptionThe XML string parameter is not well-formed.

XPathNavigator::InsertBefore(SharedPtr<XmlReader>) method

Creates a new sibling node before the currently selected node using the XML contents of the XmlReader object specified.

virtual void System::Xml::XPath::XPathNavigator::InsertBefore(SharedPtr<XmlReader> newSibling)

Arguments

ParameterTypeDescription
newSiblingSharedPtr<XmlReader>An XmlReader object positioned on the XML data for the new sibling node.

Exceptions

ExceptionDescription
ArgumentExceptionThe XmlReader object is in an error state or closed.
ArgumentNullExceptionThe XmlReader object parameter is nullptr.
InvalidOperationExceptionThe position of the XPathNavigator does not allow a new sibling node to be inserted before the current node.
NotSupportedExceptionThe XPathNavigator does not support editing.
XmlExceptionThe XML contents of the XmlReader object parameter is not well-formed.

XPathNavigator::InsertBefore(SharedPtr<XPathNavigator>) method

Creates a new sibling node before the currently selected node using the nodes in the XPathNavigator specified.

virtual void System::Xml::XPath::XPathNavigator::InsertBefore(SharedPtr<XPathNavigator> newSibling)

Arguments

ParameterTypeDescription
newSiblingSharedPtr<XPathNavigator>An XPathNavigator object positioned on the node to add as the new sibling node.

Exceptions

ExceptionDescription
ArgumentNullExceptionThe XPathNavigator object parameter is nullptr.
InvalidOperationExceptionThe position of the XPathNavigator does not allow a new sibling node to be inserted before the current node.
NotSupportedExceptionThe XPathNavigator does not support editing.

See Also