XmlParserContext クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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) |
指定した |
| XmlParserContext(XmlNameTable, XmlNamespaceManager, String, String, String, String, String, String, XmlSpace) |
指定した |
| XmlParserContext(XmlNameTable, XmlNamespaceManager, String, XmlSpace, Encoding) |
指定した |
| XmlParserContext(XmlNameTable, XmlNamespaceManager, String, XmlSpace) |
指定した |
プロパティ
| 名前 | 説明 |
|---|---|
| BaseURI |
ベース URI を取得または設定します。 |
| DocTypeName |
ドキュメント型宣言の名前を取得または設定します。 |
| Encoding |
エンコードの種類を取得または設定します。 |
| InternalSubset |
内部 DTD サブセットを取得または設定します。 |
| NamespaceManager |
XmlNamespaceManagerを取得または設定します。 |
| NameTable |
文字列のアトミック化に使用する XmlNameTable を取得します。 アトミック化された文字列の詳細については、「 XmlNameTable」を参照してください。 |
| PublicId |
パブリック識別子を取得または設定します。 |
| SystemId |
システム識別子を取得または設定します。 |
| XmlLang |
現在の |
| XmlSpace |
現在の |
メソッド
| 名前 | 説明 |
|---|---|
| Equals(Object) |
指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
| GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |