XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) Method

定義

取得命名空間名稱集合,會根據前置詞索引,可用於列舉目前在範圍中的命名空間。Gets a collection of namespace names keyed by prefix which can be used to enumerate the namespaces currently in scope.

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

參數

scope
XmlNamespaceScope XmlNamespaceScope XmlNamespaceScope XmlNamespaceScope

列舉值,指定要傳回之命名空間節點的類型。An enumeration value that specifies the type of namespace nodes to return.

傳回

目前在範圍中的命名空間和前置詞配對集合。A collection of namespace and prefix pairs currently in scope.

實作

備註

字典包含以前置詞做為索引鍵的命名空間名稱集合。The dictionary consists of a collection of namespace names keyed by prefix. 它可以用來列舉範圍內的命名空間。It can be used to enumerate the in-scope namespaces. 字典是命名空間清單的已中斷連線複本。The dictionary is a disconnected copy of the namespace list. 它會維持不變,因為目前範圍內的命名空間清單變更。It remains unchanged as the current in-scope namespace list changes.

下表顯示值如何XmlNamespaceScope影響GetNamespacesInScope方法所傳回的命名空間。The following table shows how XmlNamespaceScope values affect the namespaces returned by the GetNamespacesInScope method.

XmlNamespaceScope 值XmlNamespaceScope value xmlns: xmlxmlns:xml xmlns: xmlnsxmlns:xmlns xmlns=""xmlns=""
All Yes No No
ExcludeXml No No No
Local No No Yes

適用於

另請參閱