My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ProgrammingAPI  
Programming with the XBird API -- XQuery processor API
Phase-Implementation, Featured
Updated Feb 4, 2010 by yuin...@gmail.com

This document introduces directions for embedded uses.

Compiling and executing queries

Running 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

  • Example1.java - introduces pull/push mode with simple examples
  • XQTSTestBase - contains full-fledged (and also complex) usage of XBird API
Comment by vsbgu...@gmail.com, Jan 20, 2010

How to specify the XML source ? This example only talks about specifying the XQuery

Comment by project member yuin...@gmail.com, Jan 20, 2010

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


Sign in to add a comment
Powered by Google Project Hosting