XPath.CompilePattern MethodXPath.CompilePattern MethodXPath::CompilePattern Method

Compiles an XPath pattern and returns a XPathXPathXPath object that represents the expression.

Syntax

Public Shared Function CompilePattern( _
    pattern As String, _
    settings As XPathSettings _
) As XPath
public static XPath CompilePattern(
    string pattern,
    XPathSettings settings
)
public:
static XPath^ CompilePattern(
    String^ pattern, 
    XPathSettings^ settings
)
 

Parameters

pattern

Type: System.StringSystem.StringSystem::String^

An XPath pattern.

settings

Type: XmlPrime.XPathSettingsXmlPrime.XPathSettingsXmlPrime::XPathSettings^

The initial static context settings.

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 pattern or settings is null a null reference (Nothing in Visual Basic) nullptr
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling the expression.

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.