XmlDocumentType.Name Property


Gets the qualified name of the node.

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

public override string Name { get; }

Property Value

Type: System.String

For DocumentType nodes, this property returns the name of the document type.

The following example displays information about the DocumentType node.

using System;
using System.IO;
using System.Xml;

public class Sample
  public static void Main()
    // Create the XmlDocument.
    XmlDocument doc = new XmlDocument();
    doc.LoadXml("<!DOCTYPE book [<!ENTITY h 'hardcover'>]>" +
                "<book genre='novel' ISBN='1-861001-57-5'>" +
                "<title>Pride And Prejudice</title>" +
                "<style>&h;</style>" +

    // Display information on the DocumentType node.
    XmlDocumentType doctype = doc.DocumentType;
    Console.WriteLine("Name of the document type:  {0}", doctype.Name);
    Console.WriteLine("The internal subset of the document type:  {0}", doctype.InternalSubset);


.NET Framework
Available since 1.1
Return to top