Most recent edit on 2008-01-24 15:18:43 by JohnSnelson [Reworded]
Additions:
This example executes a simple XQuery expression ("1 to 100"), which returns the numbers from 1 to 100 inclusive. An equivalent example exists for the DOM 3 API.
Deletions:
This example executes a simple XQuery expression ("1 to 100"), which returns the numbers from 1 to 100 inclusive. The equivalent example done using the DOM 3 API can be found here.
Edited on 2007-11-30 03:50:15 by JohnSnelson [parseXQuery() -> parse()]
Additions:
AutoDelete<XQQuery> query(xqilla.parse(X("1 to 100")));
Deletions:
AutoDelete<XQQuery> query(xqilla.parseXQuery(X("1 to 100")));
Edited on 2007-11-30 02:42:00 by JohnSnelson [Fixed the example code]
Additions:
while(item = result->next(context)) {
Deletions:
while(item = result.next(context)) {
Edited on 2007-11-22 10:34:39 by JohnSnelson [Reverted to version from 2005-12-20 13:01:53]
Deletions:
olonodronca
Edited on 2007-11-16 21:01:50 by CooubOdomb
Additions:
olonodronca
Edited on 2005-12-20 13:01:53 by JohnSnelson
Additions:
This example executes a simple XQuery expression ("1 to 100"), which returns the numbers from 1 to 100 inclusive. The equivalent example done using the DOM 3 API can be found here.
Deletions:
This example executes a simple XQuery expression ("1 to 100"), which returns the numbers from 1 to 100 inclusive.
Edited on 2005-12-20 12:42:51 by JohnSnelson
Additions:
CategorySimpleAPI
Edited on 2005-12-20 12:42:06 by JohnSnelson
Additions:
This example executes a simple XQuery expression ("1 to 100"), which returns the numbers from 1 to 100 inclusive.
Oldest known version of this page was edited on 2005-12-20 12:39:42 by JohnSnelson []
Page view:
Simple API: Basic Query
#include <iostream>
#include <xqilla/xqilla-simple.hpp>
int main(int argc, char *argv[]) {
// Initialise Xerces-C and XQilla by creating the factory object
XQilla xqilla;
// Parse an XQuery expression
// (AutoDelete deletes the object at the end of the scope)
AutoDelete<XQQuery> query(xqilla.parseXQuery(X("1 to 100")));
// Create a context object
AutoDelete<DynamicContext> context(query->createDynamicContext());
// Execute the query, using the context
Result result = query->execute(context);
// Iterate over the results, printing them
Item::Ptr item;
while(item = result.next(context)) {
std::cout << UTF8(item->asString(context)) << std::endl;
}
return 0;
}