This documentation is archived and is not being maintained.

XmlNotation.NodeType Property

Gets the type of the current node.

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

public override XmlNodeType NodeType { get; }

Property Value

Type: System.Xml.XmlNodeType
The node type. For XmlNotation nodes, the value is XmlNodeType.Notation.

The following example displays information on the notations declared in the XML document.

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

public class Sample
  private const String filename = "doment.xml";

  public static void Main()
    XmlDocument doc = new XmlDocument();

    Console.WriteLine("Display information on all notations...");     
    XmlNamedNodeMap nMap = doc.DocumentType.Notations;

  public static void DisplayNotations(XmlNamedNodeMap nMap)
     for (int i=0; i < nMap.Count; i++)
        XmlNotation note = (XmlNotation) nMap.Item(i);
        Console.Write("{0} ", note.NodeType);
        Console.Write("{0} ", note.Name);
        Console.Write("{0} ", note.PublicId);
        Console.Write("{0} ", note.SystemId);
#using <mscorlib.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;

void DisplayNotations(XmlNamedNodeMap * nMap)
   for (int i = 0; i < nMap -> Count; i++) 
      XmlNotation * note = dynamic_cast<XmlNotation*>(nMap -> Item(i));
      Console::Write(S" {0} ", __box(note -> NodeType));
      Console::Write(S" {0} ", note -> Name);
      Console::Write(S" {0} ", note -> PublicId);
      Console::Write(S" {0} ", note -> SystemId);

int main() 
   XmlDocument* doc = new XmlDocument();
   doc -> Load(S"doment.xml");

   Console::WriteLine(S"Display information on all notations...");     
   XmlNamedNodeMap * nMap = doc -> DocumentType -> Notations;

The example uses the file doment.xml as input.

<!DOCTYPE doc [

  <!ELEMENT doc ANY>

  <!NOTATION w SYSTEM "wine.exe">
  <!NOTATION v PUBLIC "vine.exe">

  <!NOTATION jpg PUBLIC "Jpeg picture format">
  <!NOTATION gif SYSTEM "Gif picture format">

  <!ENTITY wn PUBLIC "" "coho.exe" NDATA w>
  <!ENTITY mytxt "Text Sample">

  <!ATTLIST doc 
        src     ENTITY         #IMPLIED
        srcs    ENTITIES       #IMPLIED
        jpgPic  NOTATION (jpg) #IMPLIED
        gifPic  NOTATION (gif) #REQUIRED>

<doc jpgPic="jpg" gifPic="gif" srcs="vn wn">

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

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