System.Xml.IXmlNamespaceResolver.GetNamespacesInScope Method

Gets a collection of defined prefix-namespace mappings that are currently in scope.

Syntax

public IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope)

Parameters

scope
An System.Xml.XmlNamespaceScope value that specifies the type of namespace nodes to return.

Returns

An IDictionary that contains the current in-scope namespaces.

Remarks

The collection is keyed by prefix and can be used to enumerate the namespaces currently in scope. The collection is a disconnected copy of the current namespace list.

The following table lists the System.Xml.XmlNamespaceScope values and how it affects the whether or not the default and built-in namespaces are returned by the IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope) method.

XmlNamespaceScope.All

yes

no

no

XmlNamespaceScope.ExcludeXml

no

no

no

XmlNamespaceScope.Local

no

no

yes

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0