Class XQueryExecutable


  • public class XQueryExecutable
    extends java.lang.Object
    An XQueryExecutable represents the compiled form of a query. To execute the query, it must first be loaded to form an XQueryEvaluator.

    An XQueryExecutable is immutable, and therefore thread-safe. It is simplest to load a new XQueryEvaluator each time the query is to be run. However, the XQueryEvaluator is serially reusable within a single thread.

    An XQueryExecutable is created by using one of the compile methods on the XQueryCompiler class.

    Since:
    9.0
    • Method Detail

      • load

        public XQueryEvaluator load()
        Load the stylesheet to prepare it for execution.
        Returns:
        An XsltTransformer. The returned XsltTransformer can be used to set up the dynamic context for stylesheet evaluation, and to run the stylesheet.
      • getResultItemType

        public ItemType getResultItemType()
        Get the ItemType of the items in the result of the query, as determined by static analysis. This is the most precise ItemType that the processor is able to determine from static examination of the query; the actual items in the query result are guaranteed to belong to this ItemType or to a subtype of this ItemType.
        Returns:
        the statically-determined ItemType of the result of the query
        Since:
        9.1
      • getResultCardinality

        public OccurrenceIndicator getResultCardinality()
        Get the statically-determined cardinality of the result of the query. This is the most precise cardinality that the processor is able to determine from static examination of the query.
        Returns:
        the statically-determined cardinality of the result of the query
        Since:
        9.1
      • isUpdateQuery

        public boolean isUpdateQuery()
        Ask whether the query is an updating query: that is, whether it returns a Pending Update List rather than a Value. Note that queries using the XUpdate copy-modify syntax are not considered to be updating queries.
        Returns:
        true if the query is an updating query, false if not
        Since:
        9.1
      • explain

        public void explain​(Destination destination)
                     throws SaxonApiException
        Produce a diagnostic representation of the compiled query, in XML form.

        The detailed form of this representation is not stable (or even documented).

        Parameters:
        destination - the destination for the XML document containing the diagnostic representation of the compiled stylesheet
        Throws:
        SaxonApiException - if an error is detected
        Since:
        9.6
      • getUnderlyingCompiledQuery

        public XQueryExpression getUnderlyingCompiledQuery()
        Get the underlying implementation object representing the compiled stylesheet. This provides an escape hatch into lower-level APIs. The object returned by this method may change from release to release.
        Returns:
        the underlying implementation of the compiled stylesheet