This documentation is archived and is not being maintained.

XmlElement.Name Property

Gets the qualified name of the node.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

'Declaration
Public Overrides ReadOnly Property Name As String

Property Value

Type: System.String
The qualified name of the node. For XmlElement nodes, this is the tag name of the element.

The following example displays information on the ISBN element.


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:ISBN>1-861001-57-5</bk:ISBN>" & _
                "<title>Pride And Prejudice</title>" & _
                "</book>")

    ' Display information on the ISBN element.
    Dim elem as XmlElement 
    elem = CType(doc.DocumentElement.ChildNodes.Item(0),XmlElement) 
    Console.Write("{0} = {1}", elem.Name, elem.InnerText)
    Console.WriteLine("  namespaceURI=" + elem.NamespaceURI)

  end sub
end class


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: