XQuery.Compile Method (string, XmlNameTable)XQuery.Compile Method (String, XmlNameTable)XQuery::Compile Method (String^, XmlNameTable^)

Compiles the specified XQuery program and returns an XQueryXQueryXQuery object that represents the XQuery program. Default static context settings are used.

Syntax

Public Shared Function Compile( _
    query As String, _
    nameTable As System.Xml.XmlNameTable _
) As XQuery
public static XQuery Compile(
    string query,
    System.Xml.XmlNameTable nameTable
)
public:
static XQuery^ Compile(
    String^ query, 
    System.Xml::XmlNameTable^ nameTable
)
 

Parameters

query

Type: System.StringSystem.StringSystem::String^

An XQuery program.

nameTable

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

The name table for documents used with this query.

Return Value

Type: XmlPrime.XQueryXmlPrime.XQueryXmlPrime::XQuery^

An XQueryXQueryXQuery 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 query or nameTable is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling the query.
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.