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)

XmlNameTableXmlNamespaceManager、ベース URI、XmlParserContextxml:lang、ドキュメント型のそれぞれの値を指定して、xml:space クラスの新しいインスタンスを初期化します。

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

XmlNameTableXmlNamespaceManager、ベース URI、XmlParserContextxml:lang、エンコーディング、およびドキュメント型のそれぞれの値を指定して、xml:space クラスの新しいインスタンスを初期化します。

XmlParserContext(XmlNameTable, XmlNamespaceManager, String, XmlSpace)

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

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

XmlNameTableXmlNamespaceManagerXmlParserContextxml: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)

適用対象