XmlAttribute.Value Property
.NET Framework 4.5
Gets or sets the value of the node.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
| Exception | Condition |
|---|---|
| ArgumentException | The node is read-only and a set operation is called. |
The following example displays information on each of the nodes in the attribute collection.
Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() Dim doc as XmlDocument = new XmlDocument() doc.LoadXml("<book xmlns:bk='urn:samples' bk:genre='novel'>" & _ "<title>Pride And Prejudice</title>" & _ "</book>") 'Create an attribute collection. Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes Console.WriteLine("Display information on each of the attributes... ") Dim attr as XmlAttribute for each attr in attrColl Console.Write("{0}:{1} = {2}", attr.Prefix, attr.LocalName, attr.Value) Console.WriteLine(" namespaceURI=" + attr.NamespaceURI) next end sub end class
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.