XPath.Compile Method (string, XmlNameTable, IXmlNamespaceResolver)XPath.Compile Method (String, XmlNameTable, IXmlNamespaceResolver)XPath::Compile Method (String^, XmlNameTable^, IXmlNamespaceResolver^)

Compiles an XPath expression and returns a XPathXPathXPath object that represents the expression with the specified in-scope namespaces.

Syntax

Public Shared Function Compile( _
    expression As String, _
    nameTable As System.Xml.XmlNameTable, _
    namespaces As System.Xml.IXmlNamespaceResolver _
) As XPath
public static XPath Compile(
    string expression,
    System.Xml.XmlNameTable nameTable,
    System.Xml.IXmlNamespaceResolver namespaces
)
public:
static XPath^ Compile(
    String^ expression, 
    System.Xml::XmlNameTable^ nameTable, 
    System.Xml::IXmlNamespaceResolver^ namespaces
)
 

Parameters

expression

Type: System.StringSystem.StringSystem::String^

An XPath expression.

nameTable

Type: System.Xml.XmlNameTableSystem.Xml.XmlNameTableSystem.Xml::XmlNameTable^

The name table used for documents used with this expression.

namespaces

Type: System.Xml.IXmlNamespaceResolverSystem.Xml.IXmlNamespaceResolverSystem.Xml::IXmlNamespaceResolver^

The in scope namespaces for the expression.

Return Value

Type: XmlPrime.XPathXmlPrime.XPathXmlPrime::XPath^

An XPathXPathXPath object, or null a null reference (Nothing in Visual Basic) nullptr if an unrecoverable error was raised and handled by a subscriber to CompilationErrorCompilationErrorCompilationError

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException expression or nameTable is null a null reference (Nothing in Visual Basic) nullptr
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling the expression.
LicenceExceptionLicenceExceptionLicenceExceptionThis version of XmlPrime has expired.

Remarks

Any errors or warnings encountered during compilation raise the CompilationErrorCompilationErrorCompilationError event. If nothing subscribes to this event then an XdmExceptionXdmExceptionXdmException is thrown if an unrecoverable error is encountered. If this event is subscribed to then the exception is not thrown, and this method returns null a null reference (Nothing in Visual Basic) nullptr instead.