com.metamatrix.query.xquery
Interface XQueryExpression

All Known Implementing Classes:
SaxonXQueryExpression

public interface XQueryExpression

An XQueryExpression - the object representation of a compiled XQuery. Must be thread-safe and immutable.


Method Summary
 void compileXQuery(java.lang.String xQueryString)
          Return the compiled XQueryExpression - the result of this call should be used as a parameter to the getDocumentNames and evaluateXQuery methods.
 java.sql.SQLXML evaluateXQuery(XQuerySQLEvaluator sqlEval)
          Evaluate the XQuery and return results.
 void setParameters(java.util.Map params)
          Set external parameter values.
 void setXMLFormat(java.lang.String xmlFormat)
          This method sets whether the documents should be returned in compact format (no extraneous whitespace).
 

Method Detail

compileXQuery

void compileXQuery(java.lang.String xQueryString)
                   throws MetaMatrixProcessingException
Return the compiled XQueryExpression - the result of this call should be used as a parameter to the getDocumentNames and evaluateXQuery methods. A null return value is interpreted to mean that XQueries are not supported by this engine at all.

Parameters:
xQueryString - the original XQuery String
Throws:
MetaMatrixProcessingException - if xQueryString is invalid and fails to compile

evaluateXQuery

java.sql.SQLXML evaluateXQuery(XQuerySQLEvaluator sqlEval)
                               throws MetaMatrixProcessingException,
                                      MetaMatrixComponentException
Evaluate the XQuery and return results. A null return value is interpreted to mean that XQueries are not supported by this engine.

Parameters:
compiledXQuery - compiled XQueryExpression
Returns:
retuns a result SQLXML object.
Throws:
MetaMatrixProcessingException - if xQueryString is invalid and fails to compile
MetaMatrixComponentException

setXMLFormat

void setXMLFormat(java.lang.String xmlFormat)
This method sets whether the documents should be returned in compact format (no extraneous whitespace). Non-compact format is more human-readable (and bigger). Additional formats may be possible in future.

Parameters:
xmlFormat - A string giving the format in which xml results need to be returned

setParameters

void setParameters(java.util.Map params)
Set external parameter values. These much match up to declared external variables in the xquery expression itself. For example, xml literal inputs need to be declared like this in the prolog: declare variable $input as node() external;

Parameters:
params - Map of parameter name -> value


Copyright © 2009. All Rights Reserved.