XmlNamedNodeMap.Item メソッド
アセンブリ: System.Xml (system.xml.dll 内)

Dim instance As XmlNamedNodeMap Dim index As Integer Dim returnValue As XmlNode returnValue = instance.Item(index)
- index
XmlNamedNodeMap から取得するノードのインデックス位置。インデックスは 0 から始まるため、最初のノードのインデックスは 0 で、最後のノードのインデックスは Count -1 になります。
指定したインデックス位置にある XmlNode。index が 0 未満か、Count プロパティ以上の場合は、null 参照 (Visual Basic では Nothing) が返されます。

XmlNamedNodeMap から継承される XmlAttributeCollection クラスを使用して、書籍のすべての属性を表示する例を次に示します。
Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() Dim doc as XmlDocument = new XmlDocument() doc.LoadXml("<book genre='novel' publicationdate='1997'> " & _ " <title>Pride And Prejudice</title>" & _ "</book>") Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes Console.WriteLine("Display all the attributes for this book...") Dim i As Integer For i = 0 To attrColl.Count - 1 Console.WriteLine("{0} = {1}", attrColl.Item(i).Name ,attrColl.Item(i).Value) Next end sub end class
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { XmlDocument doc = new XmlDocument(); doc.LoadXml("<book genre='novel' publicationdate='1997'> " + " <title>Pride And Prejudice</title>" + "</book>"); XmlAttributeCollection attrColl = doc.DocumentElement.Attributes; Console.WriteLine("Display all the attributes for this book..."); for (int i=0; i < attrColl.Count; i++) { Console.WriteLine("{0} = {1}", attrColl.Item(i).Name, attrColl.Item(i).Value); } } }
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlDocument^ doc = gcnew XmlDocument; doc->LoadXml( "<book genre='novel' publicationdate='1997'> <title>Pride And Prejudice</title></book>" ); XmlAttributeCollection^ attrColl = doc->DocumentElement->Attributes; Console::WriteLine( "Display all the attributes for this book..." ); for ( int i = 0; i < attrColl->Count; i++ ) { Console::WriteLine( "{0} = {1}", attrColl->Item( i )->Name, attrColl->Item( i )->Value ); } }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { XmlDocument doc = new XmlDocument(); doc.LoadXml("<book genre='novel' publicationdate='1997'> " + " <title>Pride And Prejudice</title>" + "</book>"); XmlAttributeCollection attrColl = doc.get_DocumentElement().get_Attributes(); Console.WriteLine("Display all the attributes for this book..."); for (int i = 0; i < attrColl.get_Count(); i++) { Console.WriteLine("{0} = {1}", attrColl.Item(i).get_Name(), attrColl.Item(i).get_Value()); } } //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に収録されているすべての辞書からXmlNamedNodeMap.Item メソッドを検索する場合は、下記のリンクをクリックしてください。

- XmlNamedNodeMap.Item メソッドのページへのリンク