GetNamespacesInScope Method

XmlNamespaceManager.GetNamespacesInScope Method (XmlNamespaceScope)

 

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

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.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.

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft