Class SaxonXQExpression

    • Method Detail

      • cancel

        public void cancel()
                    throws XQException
        Description copied from interface: XQExpression
        Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an XQExpression. This method can be used by one thread to cancel an XQExpression, that is being executed in another thread. If cancellation is not supported or the attempt to cancel the execution was not successful, the method returns without any error. If the cancellation is successful, an XQException is thrown, to indicate that it has been aborted, by executeQuery, executeCommand or any method accessing the XQResultSequence returned by executeQuery. If applicable, any open XQResultSequence and XQResultItem objects will also be implicitly closed in this case.
        Specified by:
        cancel in interface XQExpression
        Throws:
        XQException - if the expression is in a closed state
      • executeCommand

        public void executeCommand​(java.io.Reader command)
                            throws XQException
        Description copied from interface: XQExpression
        Executes an implementation-defined command. Calling this method implicitly closes any previous result sequence obtained from this expression.
        Specified by:
        executeCommand in interface XQExpression
        Parameters:
        command - the input command as a string reader
        Throws:
        XQException - if (1) there are errors when executing the command, (2) the expression is in a closed state, or (3) the execution is cancelled
      • executeCommand

        public void executeCommand​(java.lang.String command)
                            throws XQException
        Description copied from interface: XQExpression
        Executes an implementation-defined command. Calling this method implicitly closes any previous result sequence obtained from this expression.
        Specified by:
        executeCommand in interface XQExpression
        Parameters:
        command - the input command as a string
        Throws:
        XQException - if (1) there are errors when executing the command, or (2) the expression is in a closed state
      • executeQuery

        public XQResultSequence executeQuery​(java.io.InputStream query)
                                      throws XQException
        Description copied from interface: XQExpression
        Executes a query expression. This implicitly closes any previous result sequences obtained from this expression.

        If the query specifies a version declaration including an encoding, the XQJ implementation may try use this information to parse the query. In absence of the version declaration, the assumed encoding is implementation dependent.

        Specified by:
        executeQuery in interface XQExpression
        Parameters:
        query - the input query expression as a input stream object. Cannot be null
        Returns:
        an XQResultSequence containing the result of the query execution
        Throws:
        XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, or (4) the xquery parameter is null
      • executeQuery

        public XQResultSequence executeQuery​(java.io.Reader query)
                                      throws XQException
        Description copied from interface: XQExpression
        Executes a query expression. This implicitly closes any previous result sequences obtained from this expression.
        Specified by:
        executeQuery in interface XQExpression
        Parameters:
        query - the input query expression as a reader object. Cannot be null
        Returns:
        an XQResultSequence object containing the result of the query execution
        Throws:
        XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, or (4) the query parameter is null
      • executeQuery

        public XQResultSequence executeQuery​(java.lang.String query)
                                      throws XQException
        Description copied from interface: XQExpression
        Executes a query expression. This implicitly closes any previous result sequences obtained from this expression.
        Specified by:
        executeQuery in interface XQExpression
        Parameters:
        query - the input query expression string. Cannot be null
        Returns:
        an XQResultSequence object containing the result of the query execution
        Throws:
        XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null
      • getStaticContext

        public XQStaticContext getStaticContext()
                                         throws XQException
        Description copied from interface: XQExpression
        Gets an XQStaticContext representing the values for all expression properties. Note that these properties cannot be changed; in order to change, a new XQExpression needs to be created.
        Specified by:
        getStaticContext in interface XQExpression
        Returns:
        an XQStaticContext representing the values for all expression properties
        Throws:
        XQException - if the expression is in a closed state