Compile a query supplied as a String.
An XQueryExecutable
which represents the compiled query object.
The XQueryExecutable may be run as many times as required, in the same or a different
thread. The XQueryExecutable
is not affected by any changes made to the XQueryCompiler
once it has been compiled.
Using this method the query processor is provided with a string of Unicode characters, so no decoding is necessary. Any encoding information present in the version declaration is therefore ignored.
Exception Type | Condition |
---|---|
StaticError | Throws a StaticError if errors were detected during static analysis of the query. Details of the errors will be added as StaticError objects to the ErrorList if supplied; otherwise they will be written to the standard error stream. The exception that is returned is merely a summary indicating the status. |
XQueryExecutable q = compiler.Compile("distinct-values(//*/node-name()");
XQueryCompiler Class | Saxon.Api Namespace | XQueryCompiler.Compile Overload List