System.Xml.XmlNamespaceManager.GetNamespacesInScope Method

Gets a collection of namespace names keyed by prefix which can be used to enumerate the namespaces currently in scope.

Syntax

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

Parameters

scope
An enumeration value that specifies the type of namespace nodes to return.

Returns

A collection of namespace and prefix pairs currently in scope.

Remarks

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.

The following table shows how System.Xml.XmlNamespaceScope values affect the namespaces returned by the XmlNamespaceManager.GetNamespacesInScope(XmlNamespaceScope) method.

All

Yes

No

No

ExcludeXml

No

No

No

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