XmlTextReader.GetNamespacesInScope(XmlNamespaceScope) メソッド

定義

現在スコープ内にあるすべての名前空間が含まれたコレクションを取得します。

public:
 System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ GetNamespacesInScope(System::Xml::XmlNamespaceScope scope);
public System.Collections.Generic.IDictionary<string,string> GetNamespacesInScope (System.Xml.XmlNamespaceScope scope);
member this.GetNamespacesInScope : System.Xml.XmlNamespaceScope -> System.Collections.Generic.IDictionary<string, string>
Public Function GetNamespacesInScope (scope As XmlNamespaceScope) As IDictionary(Of String, String)

パラメーター

scope
XmlNamespaceScope

返される名前空間ノードの種類を指定する XmlNamespaceScope 値。

戻り値

現在スコープ内にあるすべての名前空間が含まれた IDictionary オブジェクト。 要素にリーダーが配置されていない場合は、名前空間が含まれていない空のディクショナリが返されます。

注釈

Note

.NET Framework 2.0 以降では、 メソッドを使用してXmlReader.Create新しい機能を利用してインスタンスを作成XmlReaderすることをお勧めします。

ディクショナリは、プレフィックスでキー付けされた名前空間名のコレクションで構成されます。 スコープ内の名前空間を列挙するために使用できます。 ディクショナリは、リーダーの名前空間リストの切断されたコピーです。 リーダーの位置、現在のスコープ内の名前空間リスト、変更は変更されません。

次の表では、列挙型の値が XmlNamespaceScope 、 によって GetNamespacesInScope既定の名前空間と組み込み名前空間が返されるかどうかに与える影響について説明します。

XmlNamespaceScope 値 xmlns:xml xmlns:xmlns xmlns=""
All no no
ExcludeXml no no no
Local no no はい

適用対象

こちらもご覧ください