Export (0) Print
Expand All

XmlEntity.NotationName Property

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

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

'Declaration
Public ReadOnly Property NotationName As String

Property Value

Type: System.String
The name of the NDATA attribute. If there is no NDATA, Nothing is returned.

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

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()
     doc.Load(filename)

     Console.WriteLine("Display information on all entities...")     
     Dim nMap as XmlNamedNodeMap = doc.DocumentType.Entities
     DisplayEntities(nMap)
  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)
        Console.WriteLine()
     next
  end sub
end class

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 "http://www.cohowinery.com" "coho.exe" NDATA w>
  <!ENTITY vn SYSTEM "http://www.cohovineyard.com" NDATA v>
  <!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">
    something
</doc>

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft