|
ProgrammingAPI
This document introduces directions for embedded uses. Compiling and executing queriesRunning a XML query is fairly easy. InputStream input = .. ; // a query as stream
XQueryProcessor proc = new XQueryProcessor();
// #1 compile a query
XQueryModule module = proc.parse(input);
// #2 execute the compiled expression using ``pull'' mode
Sequence<? extends Item> result = proc.execute(module);
for(Item item : result) {// Note that every Sequence instances implement Iterable.
/* do something with item. */
..
}List of examples
|
► Sign in to add a comment
How to specify the XML source ? This example only talks about specifying the XQuery
It is specified in queries by using fn:doc(URI) or fn:collection(PATH).
About fn:collection(), See http://code.google.com/p/xbird/wiki/DatabaseAdministration