XMLReader::moveToElement
XMLReader::moveToElement — 現在の属性の親要素にカーソルを移動する
説明
class XMLReader {bool moveToElement ( void )
} 現在の属性の親要素にカーソルを移動します。成功した場合に TRUE、 失敗した場合、あるいはメソッドがコールされた際の位置が属性ノードでは なかった場合に FALSE を返します。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。参考
XMLReader::moveToAttribute |
XMLReader::moveToAttributeNo |
XMLReader::moveToAttributeNs |
XMLReader::moveToFirstAttribute |
XmlReader.MoveToElement メソッド
アセンブリ: System.Xml (system.xml.dll 内)

Dim instance As XmlReader Dim returnValue As Boolean returnValue = instance.MoveToElement
リーダーが属性の位置に配置されている場合は true で、属性を所有している要素の位置にリーダーが移動します。リーダーが属性の位置に配置されていない場合は false で、リーダーの位置が変更されません。

このメソッドを使用して、要素の複数の属性間を移動した後に、その要素に戻ります。このメソッドは、リーダーを Element、DocumentType、XmlDeclaration の各ノード型に移動します。

If reader.HasAttributes Then Console.WriteLine("Attributes of <" + reader.Name + ">") Dim i As Integer For i = 0 To reader.AttributeCount reader.MoveToAttribute(i) Console.Write(" {0}={1}", reader.Name, reader.Value) Next i reader.MoveToElement() 'Moves the reader back to the element node. End If
if (reader.HasAttributes) { Console.WriteLine("Attributes of <" + reader.Name + ">"); for (int i = 0; i < reader.AttributeCount; i++) { reader.MoveToAttribute(i); Console.Write(" {0}={1}", reader.Name, reader.Value); } reader.MoveToElement(); // Moves the reader back to the element node. }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- XMLReader::moveToElementのページへのリンク