|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XPathQueryServiceImpl
Extends XPathQueryService
by additional
methods specific to eXist.
Field Summary |
---|
Fields inherited from interface org.xmldb.api.modules.XPathQueryService |
---|
SERVICE_NAME |
Method Summary | |
---|---|
void |
beginProtected()
Execute all following queries in a protected environment. |
void |
declareVariable(String qname,
Object initialValue)
Declare an external XPath variable and assign a value to it. |
void |
endProtected()
Close the protected environment. |
ResourceSet |
query(String query,
String sortExpr)
Process an XPath query and sort the results by applying a second XPath expression to each of the search results. |
ResourceSet |
query(XMLResource res,
String query)
Process an XPath query based on the result of a previous query. |
ResourceSet |
query(XMLResource res,
String query,
String sortExpr)
Process an XPath query based on the result of a previous query and sort the results using the second XPath expression. |
Methods inherited from interface org.xmldb.api.modules.XPathQueryService |
---|
clearNamespaces, getNamespace, query, queryResource, removeNamespace, setNamespace |
Methods inherited from interface org.xmldb.api.base.Service |
---|
getName, getVersion, setCollection |
Methods inherited from interface org.xmldb.api.base.Configurable |
---|
getProperty, setProperty |
Method Detail |
---|
ResourceSet query(XMLResource res, String query) throws XMLDBException
res
- an XMLResource as obtained from a previous query.query
- the XPath query
XMLDBException
ResourceSet query(XMLResource res, String query, String sortExpr) throws XMLDBException
res
- an XMLResource as obtained from a previous queryquery
- the XPath querysortExpr
- another XPath expression, which is executed relative to
the results of the primary expression. The result of applying sortExpr is converted
to a string value, which is then used to sort the results.
XMLDBException
ResourceSet query(String query, String sortExpr) throws XMLDBException
query
- the XPath querysortExpr
- another XPath expression, which is executed relative to the
results of the primary expression.
XMLDBException
void declareVariable(String qname, Object initialValue) throws XMLDBException
declareVariable("name", "HAMLET");you may use the variable in an XPath expression as follows:
//SPEECH[SPEAKER=$name]Any Java object may be passed as initial value. The query engine will try to map this into a corresponding XPath value. You may also pass an XMLResource as obtained from another XPath expression. This will be converted into a node.
qname
- a valid QName by which the variable is identified. Any
prefix should have been mapped to a namespace, i.e. if a variable is called
x:name, there should be a prefix/namespace mapping for the prefix
xinitialValue
- the initial value, which is assigned to the variable
XMLDBException
void beginProtected() throws XMLDBException
endProtected()
is called.
XMLDBException
void endProtected()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |