System.Xml.XPath.XPathNavigator.GetNamespace Method

Returns the value of the namespace node corresponding to the specified local name.

Syntax

public virtual string GetNamespace (string name)

Parameters

name
The local name of the namespace node.

Returns

A string that contains the value of the namespace node; string.Empty if a matching namespace node is not found, or if the System.Xml.XPath.XPathNavigator is not positioned on an element node.

Remarks

Namespaces xml and xmlns always return a value. If string.Empty is specified as the name parameter, the XPathNavigator.GetNamespace(string) method returns the default xmlns namespace.

For a definition of namespace nodes, see section 5.4 of the W3C XML Path Language (XPath) recommendation located at http://www.w3.org/TR/xpath#data-model.

This method does not affect the state of the System.Xml.XPath.XPathNavigator.

Requirements

Namespace: System.Xml.XPath
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0