System.Xml
2.0.0.0
4.0.0.0
To be added.
Provides read-only access to a set of prefix and namespace mappings.
Method
2.0.0.0
4.0.0.0
System.Collections.Generic.IDictionary<System.String,System.String>
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 values and how it affects the whether or not the default and built-in namespaces are returned by the method.
-
XmlNamespaceScope value
xmlns:xml
xmlns:xmlns
xmlns=""
-
yes
no
no
-
no
no
no
-
no
no
yes
Gets a collection of defined prefix-namespace mappings that are currently in scope.
An that contains the current in-scope namespaces.
An value that specifies the type of namespace nodes to return.
Method
2.0.0.0
4.0.0.0
System.String
Namespace URI-to-prefix mappings can change from node to node in an XML document. You cannot depend on the result of a lookup being consistent from one node to the next.
The following table describes how the default and built-in namespaces are handled by the method.
-
Prefix
Return Value
-
xml
http://www.w3.org/XML/1998/namespace
-
xmlns
http://www.w3.org/2000/xmlns/
-
String.Empty (A default namespace has been assigned).
The currently assigned default namespace.
-
String.Empty (The default namespace has not been explicitly assigned).
String.Empty (The blank prefix is associated with elements that are not in any namespace).
Gets the namespace URI mapped to the specified prefix.
The namespace URI that is mapped to the prefix; null if the prefix is not mapped to a namespace URI.
The prefix whose namespace URI you wish to find.
Method
2.0.0.0
4.0.0.0
System.String
It is possible for a namespace URI to be mapped to multiple prefixes. Because the prefixes are not mapped in a predictable manner, you should not depend on getting back a particular prefix when a namespace URI is mapped to more than one prefix.
Namespace URI to prefix mappings can change from node to node in an XML document. You cannot depend on the result of a lookup being consistent from one node to the next.
The following table describes how the default and built-in namespaces are handled by the method.
-
Namespace
Return value
-
http://www.w3.org/XML/1998/namespace
xml
-
http://www.w3.org/2000/xmlns/
xmlns
-
An empty namespace.
A default namespace that has not been defined.
Gets the prefix that is mapped to the specified namespace URI.
The prefix that is mapped to the namespace URI; null if the namespace URI is not mapped to a prefix.
The namespace URI whose prefix you wish to find.