XmlNode.ChildNodes プロパティ
アセンブリ: System.Xml (system.xml.dll 内)
構文ノードのすべての子ノードを格納している XmlNodeList。 子ノードがない場合、このプロパティは空の XmlNodeList を返します。
使用例Option Strict Option Explicit Imports System Imports System.IO Imports System.Xml Public Class Sample Public Shared Sub Main() Dim doc As New XmlDocument() doc.LoadXml("<book ISBN='1-861001-57-5'>" & _ "<title>Pride And Prejudice</title>" & _ "<price>19.95</price>" & _ "</book>") Dim root As XmlNode = doc.FirstChild 'Display the contents of the child nodes. If root.HasChildNodes Then Dim i As Integer For i = 0 To root.ChildNodes.Count - 1 Console.WriteLine(root.ChildNodes(i).InnerText) Next i End If End Sub 'Main End Class 'Sample
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { XmlDocument doc = new XmlDocument(); doc.LoadXml("<book ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "<price>19.95</price>" + "</book>"); XmlNode root = doc.FirstChild; //Display the contents of the child nodes. if (root.HasChildNodes) { for (int i=0; i<root.ChildNodes.Count; i++) { Console.WriteLine(root.ChildNodes[i].InnerText); } } } }
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlDocument^ doc = gcnew XmlDocument; doc->LoadXml( "<book ISBN='1-861001-57-5'>" "<title>Pride And Prejudice</title>" "<price>19.95</price>" "</book>" ); XmlNode^ root = doc->FirstChild; //Display the contents of the child nodes. if ( root->HasChildNodes ) { for ( int i = 0; i < root->ChildNodes->Count; i++ ) { Console::WriteLine( root->ChildNodes[ i ]->InnerText ); } } }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { XmlDocument doc = new XmlDocument(); doc.LoadXml("<book ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "<price>19.95</price>" + "</book>"); XmlNode root = doc.get_FirstChild(); //Display the contents of the child nodes. if (root.get_HasChildNodes()) { for (int i = 0; i < root.get_ChildNodes().get_Count(); i++) { Console.WriteLine(root.get_ChildNodes().Item(i).get_InnerText()); } } } //main } //Sample
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Weblioに収録されているすべての辞書からXmlNode.ChildNodes プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からXmlNode.ChildNodes プロパティ
を検索
- XmlNode.ChildNodes プロパティのページへのリンク