XmlDocumentType.Name プロパティ
ノードの限定名を取得します。
Overrides Public ReadOnly Property Name As String
[C#]
public override string Name {get;}
[C++]
public: __property String* get_Name();
[JScript]
public override function get Name() : String;
プロパティ値
DocumentType ノードの場合、このプロパティはドキュメント型の名前を返します。
使用例
[Visual Basic, C#, C++] DocumentType ノードに関する情報を表示する例を次に示します。
Option Explicit
Option Strict
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
' Create the XmlDocument.
Dim doc As 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>" & _
"</book>")
' Display information on the DocumentType node.
Dim doctype As XmlDocumentType = doc.DocumentType
Console.WriteLine("Name of the document type: {0}", doctype.Name)
Console.WriteLine("The internal subset of the document type: {0}", doctype.InternalSubset)
End Sub 'Main
End Class 'Sample
[C#]
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>" +
"</book>");
// 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);
}
}
[C++]
#using <mscorlib.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
// Create the XmlDocument.
XmlDocument* doc = new XmlDocument();
doc->LoadXml(S"<!DOCTYPE book [<!ENTITY h 'hardcover'>]>"
S"<book genre='novel' ISBN='1-861001-57-5'>"
S"<title>Pride And Prejudice</title>"
S"<style>&h;</style>"
S"</book>");
// Display information on the DocumentType node.
XmlDocumentType* doctype = doc->DocumentType;
Console::WriteLine(S"Name of the document type: {0}", doctype->Name);
Console::WriteLine(S"The internal subset of the document type: {0}",
doctype->InternalSubset);
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ