XmlLinkedNode.NextSibling プロパティ
このノードの直後のノードを取得します。
Overrides Public ReadOnly Property NextSibling As XmlNode
[C#]
public override XmlNode NextSibling {get;}
[C++]
public: __property XmlNode* get_NextSibling();
[JScript]
public override function get NextSibling() : XmlNode;
プロパティ値
このノードの直後の XmlNode 。直後のノードが存在しない場合は null 参照 (Visual Basic では Nothing) 。
使用例
[Visual Basic, C#, C++] 最初の 2 つの Book ノードの例を次に示します。
Imports System
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.Load("books.xml")
' Display the first two book nodes
Dim book as XmlNode = doc.DocumentElement.FirstChild
Console.WriteLine(book.OuterXml)
Console.WriteLine()
Console.WriteLine(book.NextSibling.OuterXml)
end sub
end class
[C#]
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
// Display the first two book nodes.
XmlNode book = doc.DocumentElement.FirstChild;
Console.WriteLine(book.OuterXml);
Console.WriteLine();
Console.WriteLine(book.NextSibling.OuterXml);
}
}
[C++]
#using <mscorlib.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
XmlDocument* doc = new XmlDocument();
doc->Load(S"books.xml");
// Display the first two book nodes.
XmlNode* book = doc->DocumentElement->FirstChild;
Console::WriteLine(book->OuterXml);
Console::WriteLine();
Console::WriteLine(book->NextSibling->OuterXml);
};
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
XmlLinkedNode クラス | XmlLinkedNode メンバ | System.Xml 名前空間 | PreviousSibling