Qizx/open API

net.axyana.qizxopen.xquery
Class XQueryPreparedExpression

java.lang.Object
  extended bynet.axyana.qizxopen.xquery.XQueryEnvironment
      extended bynet.axyana.qizxopen.xquery.XQueryExpression
          extended bynet.axyana.qizxopen.xquery.XQueryPreparedExpression
All Implemented Interfaces:
java.io.Serializable

public class XQueryPreparedExpression
extends XQueryExpression

Prepared XQuery Expressions are compiled once and can be used multiple times, changing global variable values.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.axyana.qizxopen.xquery.XQueryEnvironment
DOC_BASE_URI, EXEC_TIMEOUT, MODULE_BASE_URI, SOURCE_URI, TRACE_EXECUTION, TRACE_QUERY_COMPIL
 
Method Summary
 XQResultSequence executeQuery()
          Executes the prepared expression.
 void executeQuery(XMLEventReceiver result)
          Executes the expression, generates the result directly to a XML event handler, such as a XMLSerializer or a DOM builder.
 java.lang.String executeQuery(XMLSerialOptions serialOptions)
          Compiles and executes a expression, then serializes the results as a string.
 java.lang.String executeQuery(XSLTOptions xsltOptions)
          Executes the prepared expression, then pass the result tree to a XSLT processor.
 XQueryPragma[] getPragmas()
          Returns the description of the pragmas found at the head of the query.
 
Methods inherited from class net.axyana.qizxopen.xquery.XQueryExpression
executeQuery, executeQuery, executeQuery, executeQuery, getConnection, getInScopeNS, getType, monitor
 
Methods inherited from class net.axyana.qizxopen.xquery.XQueryEnvironment
authorizeClass, bind, bind, bindDouble, bindLong, bindObject, bindString, bindStringArray, defineGlobal, defineNamespace, getMessages, getSysProperty, registerCollation, setCollectionInput, setCurrentItem, setDefaultCollation, setDocumentInput, setDocumentInput, setFragmentInput, setImplicitTimezone, setInput, setInputDocument, setSysProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

executeQuery

public XQResultSequence executeQuery()
                              throws XQueryException
Executes the prepared expression.

Returns:
a sequence of Items.
Throws:
XQueryException

executeQuery

public void executeQuery(XMLEventReceiver result)
                  throws XQueryException
Executes the expression, generates the result directly to a XML event handler, such as a XMLSerializer or a DOM builder.

This may be more efficient than constructing a tree in memory then serializing.

The query must evaluate as a single Node, otherwise an EvalException is raised.

See XQueryExpression.executeQuery(String query) for more details

Parameters:
result - an object receiving XML data as a stream of events. Implementations include XMLSerializer and DOMBuilder.
Throws:
XQueryException

executeQuery

public java.lang.String executeQuery(XMLSerialOptions serialOptions)
                              throws XQueryException,
                                     DataModelException
Compiles and executes a expression, then serializes the results as a string. The query must evaluate as a single Node, otherwise an EvalException is raised.

See executeQuery() for more details

Parameters:
serialOptions - a set of properties defining serialization options (see XMLSerializer for details).
Returns:
a string representing the serialized result of the query. Notice that even though an encoding is specified in
Throws:
XQueryException
DataModelException

executeQuery

public java.lang.String executeQuery(XSLTOptions xsltOptions)
                              throws XQueryException
Executes the prepared expression, then pass the result tree to a XSLT processor. The output of the XSLT processor is serialized using xsl:output specifications in the XSLT stylesheet, then returned as a string. The query must evaluate as a single Node, otherwise an EvalException is raised.

See executeQuery() for more details

Parameters:
xsltOptions - a set of properties defining XSLT options and parameters.
Returns:
a string representing the serialized result of the query. Notice that even if an encoding is specified in the options, the result is provided as a string of unencoded characters.
Throws:
XQueryException

getPragmas

public XQueryPragma[] getPragmas()
                          throws XQueryException
Returns the description of the pragmas found at the head of the query.

Throws:
XQueryException

© 2005 Axyana Software