XmlDocumentType.Notations 속성

정의

문서 형식 선언에 있는 XmlNotation 노드의 컬렉션을 가져옵니다.

public:
 property System::Xml::XmlNamedNodeMap ^ Notations { System::Xml::XmlNamedNodeMap ^ get(); };
public System.Xml.XmlNamedNodeMap Notations { get; }
member this.Notations : System.Xml.XmlNamedNodeMap
Public ReadOnly Property Notations As XmlNamedNodeMap

속성 값

XmlNotation 노드가 포함된 XmlNamedNodeMap입니다. 반환된 XmlNamedNodeMap은 읽기 전용입니다.

예제

다음 예제에서는 XML 문서에 선언된 표기법 정보를 표시합니다.

#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( " {0} ", note->NodeType );
      Console::Write( " {0} ", note->Name );
      Console::Write( " {0} ", note->PublicId );
      Console::Write( " {0} ", note->SystemId );
      Console::WriteLine();

   }
}

int main()
{
   XmlDocument^ doc = gcnew XmlDocument;
   doc->Load( "doment.xml" );
   Console::WriteLine( "Display information on all notations..." );
   XmlNamedNodeMap^ nMap = doc->DocumentType->Notations;
   DisplayNotations( nMap );
}
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();
    doc.Load(filename);

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

  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);
        Console.WriteLine();
    }
  }
}
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 notations...")     
    Dim nMap as XmlNamedNodeMap = doc.DocumentType.Notations
    DisplayNotations(nMap)      
  end sub
 
  public shared sub DisplayNotations(nMap as XmlNamedNodeMap)
     Dim i as integer   
     for i = 0 to nMap.Count - 1
        Dim note as XmlNotation = CType(nMap.Item(i), XmlNotation)
        Console.Write("{0} ", note.NodeType)
        Console.Write("{0} ", note.Name)
        Console.Write("{0} ", note.PublicId)
        Console.Write("{0} ", note.SystemId)
        Console.WriteLine()
     next
  end sub            
end class

이 예제에서는 파일을 doment.xml 입력으로 사용합니다.

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

설명

표기법이 반환되는 순서는 이러한 항목이 문서에 나타날 수 있는 순서를 기반으로 하지 않습니다. 또한 순서는 유사한 문서 간에 또는 클래스의 다른 구현 또는 버전 간에 동일하도록 보장되지 않습니다.

적용 대상

추가 정보