System.Xml.XmlReader.Name Property

When overridden in a derived class, gets the qualified name of the current node.

Syntax

public virtual string Name { get; }

Value

A string containing the qualified name of the current node or, for node types that do not have a name (like Text, Comment , and so on), string.Empty.

Remarks

Operation

The qualified name is equivalent to the XmlReader.LocalName prefixed with XmlReader.Prefix and the ':' character. For example, XmlReader.Name is "bk:book" for the element <bk:book>.

The name returned is dependent on the XmlReader.NodeType of the node. The following node types return the listed values. All other node types return an empty string.

Node TypeName
Attribute The name of the attribute.
DocumentType The document type name.
Element The tag name.
EntityReference The name of the entity referenced.
ProcessingInstruction The target of the processing instruction.
XmlDeclaration The literal string "xml".

This property is read-only.

Note to Inheritors
This property must be overridden in order to provide the functionality described above, as there is no default implementation.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0