System.Xml.XPath.XPathExpression.SetContext Method

When overridden in a derived class, specifies the System.Xml.XmlNamespaceManager object to use for namespace resolution.

Syntax

public abstract void SetContext (System.Xml.XmlNamespaceManager nsManager)

Parameters

nsManager
An System.Xml.XmlNamespaceManager object to use for namespace resolution.

Remarks

Namespace resolution is supported using the System.Xml.XmlNamespaceManager class which stores prefix and namespace Uniform Resource Identifier (URI) mappings. If the System.Xml.XPath.XPathExpression requires namespace resolution, the prefix and namespace URI pair must be added to the System.Xml.XmlNamespaceManager object and the XPathExpression.SetContext(System.Xml.XmlNamespaceManager) method must be called to specify the System.Xml.XmlNamespaceManager object to use for namespace resolution.

The following are important notes to consider when using the XPathExpression.SetContext(System.Xml.XmlNamespaceManager) method.

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