This documentation is archived and is not being maintained.

XmlEntity.NotationName Property

Gets the name of the optional NDATA attribute on the entity declaration.

[Visual Basic]
Public ReadOnly Property NotationName As String
public string NotationName {get;}
public: __property String* get_NotationName();
public function get NotationName() : String;

Property Value

The name of the NDATA attribute. If there is no NDATA, a null reference (Nothing in Visual Basic) is returned.


[Visual Basic, C#, C++] The following example displays information on the entities declared in the XML document.

[Visual Basic] 
Imports System
Imports System.IO
Imports System.Xml
public class Sample

  private const filename as String = "doment.xml"
  public shared sub Main()
     Dim doc as XmlDocument = new XmlDocument()
     Console.WriteLine("Display information on all entities...")     
     Dim nMap as XmlNamedNodeMap = doc.DocumentType.Entities
  end sub
  public shared sub DisplayEntities(nMap as XmlNamedNodeMap)
     Dim i as integer   
     for i = 0 to nMap.Count - 1
        Dim ent as XmlEntity = CType(nMap.Item(i), XmlEntity)
        Console.Write("{0} ", ent.NodeType)
        Console.Write("{0} ", ent.Name)
        Console.Write("{0} ", ent.NotationName)
        Console.Write("{0} ", ent.PublicId)
        Console.Write("{0} ", ent.SystemId)
  end sub
end class

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 entities...");     
     XmlNamedNodeMap nMap = doc.DocumentType.Entities;
  public static void DisplayEntities(XmlNamedNodeMap nMap)
     for (int i=0; i < nMap.Count; i++)
        XmlEntity ent = (XmlEntity) nMap.Item(i);
        Console.Write("{0} ", ent.NodeType);
        Console.Write("{0} ", ent.Name);
        Console.Write("{0} ", ent.NotationName);
        Console.Write("{0} ", ent.PublicId);
        Console.Write("{0} ", ent.SystemId);

#using <mscorlib.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;

__gc public class Sample 
   static void DisplayEntities(XmlNamedNodeMap * nMap)
      for (int i = 0; i < nMap -> Count; i++) 
         XmlEntity * ent = dynamic_cast<XmlEntity*>(nMap -> Item(i));
         Console::Write(S" {0} ", __box(ent -> NodeType));
         Console::Write(S" {0} ", ent -> Name);
         Console::Write(S" {0} ", ent -> NotationName);
         Console::Write(S" {0} ", ent -> PublicId);
         Console::Write(S" {0} ", ent -> SystemId);

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

   Console::WriteLine(S"Display information on all entities...");     
   XmlNamedNodeMap * nMap = doc -> DocumentType -> Entities;
   Sample * MySample = new Sample();
   MySample -> DisplayEntities(nMap);

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">

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

XmlEntity Class | XmlEntity Members | System.Xml Namespace | XmlDocumentType