System.Xml.XPath.XPathNavigator.MoveToFirstNamespace Method

Moves the System.Xml.XPath.XPathNavigator to first namespace node of the current node.

Syntax

public bool MoveToFirstNamespace ()

Returns

Returns true if the System.Xml.XPath.XPathNavigator is successful moving to the first namespace node; otherwise, false. If false, the position of the System.Xml.XPath.XPathNavigator is unchanged.

Remarks

The System.Xml.XPath.XPathNavigator class returns namespace nodes in reverse document order. Therefore, XPathNavigator.MoveToFirstNamespace essentially moves to the last namespace node in the current scope.

After the System.Xml.XPath.XPathNavigator has been moved to the namespace node, the XPathNavigator.Name property reflects the name of the namespace.

When the System.Xml.XPath.XPathNavigator is positioned on a namespace node, the methods XPathNavigator.MoveToNext, XPathNavigator.MoveToPrevious, and XPathNavigator.MoveToFirst are not applicable. These methods always return false and do not change the position of the System.Xml.XPath.XPathNavigator. Rather, you can call XPathNavigator.MoveToNextNamespace to move to the next namespace node.

After the System.Xml.XPath.XPathNavigator is positioned on an namespace node, call XPathNavigator.MoveToParent to move back to the element node.

For a definition of namespace nodes, see section 5.4 of the W3C XML Path Language (XPath) recommendation located at http://www.w3.org/TR/xpath#data-model.

Requirements

Namespace: System.Xml.XPath
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0