MoveToElement Method

XmlReader.MoveToElement Method

When overridden in a derived class, moves to the element that contains the current attribute node.

[Visual Basic]
Public MustOverride Function MoveToElement() As Boolean
public abstract bool MoveToElement();
public: virtual bool MoveToElement() = 0;
public abstract function MoveToElement() : Boolean;

Return Value

true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change).


Use this method to return to an element after navigating through its attributes. This method moves the reader to one of the following node types: Element, DocumentType, or XmlDeclaration.


See MoveToElement (in the XmlTextReader class) for an example using this method.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlReader Class | XmlReader Members | System.Xml Namespace

© 2015 Microsoft