XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) 方法

定义

获取被可用于枚举当前范围内的命名空间的前缀键控的命名空间名称的集合。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

一个指定要返回的命名空间节点的类型的枚举值。An enumeration value that specifies the type of namespace nodes to return.

返回

IDictionary<String,String>

当前范围中的命名空间和前缀对的集合。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 值如何影响方法返回的命名空间 GetNamespacesInScopeThe 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

适用于