XmlAttributeCollection.ItemOf-Eigenschaft (Int32)
.NET Framework 3.0
Ruft das Attribut mit dem angegebenen Index ab.
Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)
Assembly: System.Xml (in system.xml.dll)
Diese Eigenschaft ist eine Microsoft-Erweiterung des Dokumentobjektmodells (Document Object Model, DOM). Sie entspricht dem Aufruf von XmlNamedNodeMap.Item.
Im folgenden Beispiel werden alle Attribute in der Auflistung angezeigt.
using System; using System.IO; using System.Xml; public class Sample { public static void Main(){ XmlDocument doc = new XmlDocument(); doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "</book>"); //Create an attribute collection. XmlAttributeCollection attrColl = doc.DocumentElement.Attributes; Console.WriteLine("Display all the attributes in the collection...\r\n"); for (int i=0; i < attrColl.Count; i++) { Console.Write("{0} = ", attrColl[i].Name); Console.Write("{0}", attrColl[i].Value); Console.WriteLine(); } } }
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.