|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XQueryExpression
This class defines an interface for the use of XQuery processors with MorganaXProc
. It
allows you to use any XQuery processor you like in 'p:xquery' by just wrapping an
XQueryConnector
around it.
The interface to XQuery processors comes in two classes:
XQueryConnector
serves as the basic connection to the used
XQuery processor. It holds the basic information of the connector and
is used to set some configuration. The basis task of XQueryConnector
is to create an instance of XQueryExpression
as an executable form
of an XQuery expression in compile()
.
XQueryExpression
is then used to set the dynamic context of
the expression and run it to produce a sequence of nodes from the context item.
Method Summary | |
---|---|
boolean |
evaluate(nu.xom.Document context)
Evaluates the compiled XQuery expression with the given document (the first document in port 'source' of p:xquery) as context item. |
javax.xml.namespace.QName |
getErrorCode()
|
nu.xom.Document |
getErrorDocument()
Return an xom document with the errors occurred during execution of the XQuery expression. |
nu.xom.Node[] |
getResult()
Returns the result of the evaluation of the XQuery expression as an array of nodes. |
void |
setCollectionURIResolver(CollectionURIResolver resolver)
Sets the resolver to use in query evaluation for fn:collection |
void |
setDefaultCollection(nu.xom.Document[] sequence)
Sets the default collection, i.e. the sequence of documents available on port "source" of p:xquery. |
void |
setParameter(javax.xml.namespace.QName name,
java.lang.String value)
Sets the parameters on port 'parameters' of p:xquery. |
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Sets the uri resolver to use in query evaluation for fn:doc. |
Method Detail |
---|
void setDefaultCollection(nu.xom.Document[] sequence) throws XPathException
sequence
- the default collection for the xquery expression.
XPathException
- if memory is exceeded.javax.xml.namespace.QName getErrorCode()
nu.xom.Document getErrorDocument()
evaluate
returns false
. The return value in case of
a successful execution of the expression is not defined.
void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- the uri resolver to use.void setCollectionURIResolver(CollectionURIResolver resolver)
resolver
- the resolver to usevoid setParameter(javax.xml.namespace.QName name, java.lang.String value)
name
- the name of the parameter to set.value
- the value of the parameter to set.boolean evaluate(nu.xom.Document context)
context
- the context item
true
if execution was successful, false
if an error occurred.nu.xom.Node[] getResult() throws XPathException
evaluate
return true
. the return value in case of a
failed execution of the expression is not defined.
XPathException
- if conversion failed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |