Export (0) Print
Expand All

XmlNamespaceManager.GetNamespacesInScope Method

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

Namespace:  System.Xml
Assemblies:   System.Xml (in System.Xml.dll)
  System.Xml.ReaderWriter (in System.Xml.ReaderWriter.dll)

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

Parameters

scope
Type: System.Xml.XmlNamespaceScope

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

Return Value

Type: System.Collections.Generic.IDictionary<String, String>
A collection of namespace and prefix pairs currently in scope.

Implements

IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope)

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 XmlNamespaceScope values affect the namespaces returned by the GetNamespacesInScope method.

XmlNamespaceScope value

xmlns:xml

xmlns:xmlns

xmlns=""

All

Yes

No

No

ExcludeXml

No

No

No

Local

No

No

Yes

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft