Export (0) Print
Expand All

XPathNavigator.MoveToAttribute Method

Moves to the attribute with matching LocalName and NamespaceURI.

[Visual Basic]
Public MustOverride Function MoveToAttribute( _
   ByVal localName As String, _
   ByVal namespaceURI As String _
) As Boolean
[C#]
public abstract bool MoveToAttribute(
 string localName,
 string namespaceURI
);
[C++]
public: virtual bool MoveToAttribute(
 String* localName,
 String* namespaceURI
) = 0;
[JScript]
public abstract function MoveToAttribute(
   localName : String,
 namespaceURI : String
) : Boolean;

Parameters

localName
The local name of the attribute.
namespaceURI
The namespace URI of the attribute. If this is a null reference (Nothing in Visual Basic), an empty namespace is assumed.

Return Value

true if the attribute is found; otherwise, false. If false, the position of the navigator does not change.

Remarks

If the navigator is not currently positioned on an element, this method returns false.

After a successful call to MoveToAttribute, the LocalName, NamespaceURI and Prefix properties reflect the values of the attribute. When the navigator is positioned on an attribute, the methods MoveToNext, MoveToPrevious, and MoveToFirst are not applicable. These methods always return false and do not change the position of the navigator. Rather, you can call MoveToNextAttribute to move to the next attribute node.

Once positioned on an attribute, you can call MoveToParent to move to the owner element.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

XPathNavigator Class | XPathNavigator Members | System.Xml.XPath Namespace | MoveToFirstAttribute | MoveToNextAttribute | GetAttribute

Show:
© 2014 Microsoft