System.Xml.XPath.XPathNavigator.MoveToFirstAttribute Method

When overridden in a derived class, moves the System.Xml.XPath.XPathNavigator to the first attribute of the current node.

Syntax

public abstract bool MoveToFirstAttribute ()

Returns

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

Remarks

If the System.Xml.XPath.XPathNavigator is not currently positioned on an element, this method returns false and the position of the System.Xml.XPath.XPathNavigator does not change.

After a successful call to XPathNavigator.MoveToFirstAttribute, the XPathNavigator.LocalName, XPathNavigator.NamespaceURI and XPathNavigator.Prefix properties reflect the values of the attribute. When the System.Xml.XPath.XPathNavigator is positioned on an attribute, 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.MoveToNextAttribute to move to the next attribute node.

After the System.Xml.XPath.XPathNavigator is positioned on an attribute, you can call XPathNavigator.MoveToParent to move to the owner element.

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