XQuery.Compile Method (Uri, Stream, XQuerySettings)XQuery.Compile Method (Uri, Stream, XQuerySettings)XQuery::Compile Method (Uri^, Stream^, XQuerySettings^)
Syntax
Public Shared Function Compile( _ source As Uri, _ stream As System.IO.Stream, _ settings As XQuerySettings _ ) As XQuery
public static XQuery Compile( Uri source, System.IO.Stream stream, XQuerySettings settings )
public: static XQuery^ Compile( Uri^ source, System.IO::Stream^ stream, XQuerySettings^ settings )
Parameters
- source
Type: System.UriSystem.UriSystem::Uri^
The base URI of the query.
- stream
Type: System.IO.StreamSystem.IO.StreamSystem.IO::Stream^
The StreamStreamStream from which to read the XQuery expression.
- settings
Type: XmlPrime.XQuerySettingsXmlPrime.XQuerySettingsXmlPrime::XQuerySettings^
The initial static context settings.
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
Exception | Condition |
ArgumentNullExceptionArgumentNullExceptionArgumentNullException |
stream or settings is null
a null reference (Nothing in Visual Basic)
nullptr .
|
XdmExceptionXdmExceptionXdmException | An error occurred compiling the query. |
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 returnsnull
a null reference (Nothing
in Visual Basic)
nullptr
instead.
If it is not null
a null reference (Nothing
in Visual Basic)
nullptr
, the source parameter is used as the base URI
of the query if the query does not include a base-uri
declaration.