XmlParserContext クラス

定義

XML フラグメントを解析するために XmlReader に必要なすべてのコンテキスト情報を提供します。

public ref class XmlParserContext
public class XmlParserContext
type XmlParserContext = class
Public Class XmlParserContext
継承
XmlParserContext

次の例では、XML フラグメントを読み取る XmlReader オブジェクトを作成します。

string xmlFrag ="<item rk:ID='abc-23'>hammer</item> " +
                        "<item rk:ID='r2-435'>paint</item>" +
                        "<item rk:ID='abc-39'>saw</item>";

// Create the XmlNamespaceManager.
NameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
nsmgr.AddNamespace("rk", "urn:store-items");

// Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);

// Create the reader.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
XmlReader reader = XmlReader.Create(new StringReader(xmlFrag), settings, context);
Dim xmlFrag As String = "<item rk:ID='abc-23'>hammer</item> " & _
                                     "<item rk:ID='r2-435'>paint</item>" & _
                                     "<item rk:ID='abc-39'>saw</item>"

' Create the XmlNamespaceManager.
Dim nt As New NameTable()
Dim nsmgr As New XmlNamespaceManager(nt)
nsmgr.AddNamespace("rk", "urn:store-items")

' Create the XmlParserContext.
Dim context As New XmlParserContext(Nothing, nsmgr, Nothing, XmlSpace.None)

' Create the reader. 
Dim settings As New XmlReaderSettings()
settings.ConformanceLevel = ConformanceLevel.Fragment
Dim reader As XmlReader = XmlReader.Create(New StringReader(xmlFrag), settings, context)

コンストラクター

名前 説明
XmlParserContext(XmlNameTable, XmlNamespaceManager, String, String, String, String, String, String, XmlSpace, Encoding)

指定したXmlParserContextXmlNameTable、基本 URI、XmlNamespaceManagerxml:lang、エンコード、ドキュメント型の値を使用して、xml:space クラスの新しいインスタンスを初期化します。

XmlParserContext(XmlNameTable, XmlNamespaceManager, String, String, String, String, String, String, XmlSpace)

指定したXmlParserContextXmlNameTable、基本 URI、XmlNamespaceManagerxml:lang、ドキュメント型の値を使用して、xml:space クラスの新しいインスタンスを初期化します。

XmlParserContext(XmlNameTable, XmlNamespaceManager, String, XmlSpace, Encoding)

指定したXmlParserContextXmlNameTableXmlNamespaceManagerxml:lang、エンコードを使用して、xml:space クラスの新しいインスタンスを初期化します。

XmlParserContext(XmlNameTable, XmlNamespaceManager, String, XmlSpace)

指定したXmlParserContextXmlNameTableXmlNamespaceManager、およびxml:lang値を使用して、xml:space クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
BaseURI

ベース URI を取得または設定します。

DocTypeName

ドキュメント型宣言の名前を取得または設定します。

Encoding

エンコードの種類を取得または設定します。

InternalSubset

内部 DTD サブセットを取得または設定します。

NamespaceManager

XmlNamespaceManagerを取得または設定します。

NameTable

文字列のアトミック化に使用する XmlNameTable を取得します。 アトミック化された文字列の詳細については、「 XmlNameTable」を参照してください。

PublicId

パブリック識別子を取得または設定します。

SystemId

システム識別子を取得または設定します。

XmlLang

現在の xml:lang スコープを取得または設定します。

XmlSpace

現在の xml:space スコープを取得または設定します。

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象