C API Documentation

Zorba implements the XQC (XQuery C) API which was designed with the goal to create a standardized C API for interfacing with XQuery processors. XQC provides mechanisms to compile and execute XQueries, manage contexts, and provide a basic interface for the XQuery Data Model (XDM). The project is available under the BSD License and is hosted on http://www.sourceforge.net. It is a joint effort between XQilla and the FLWOR Foundation's Zorba Group with the goal to make these two XQuery processor easily exchangeable. However, XQC is still in it's early stages. Zorba implements most of the things that are specified in XQC but also deviates from and enhances the XQC specification to some degree. For instance, the following list contains the differences between the current implementation of Zorba's C API and XQC.
  • Zorba's error codes and its error handler differ from the XQC specification.
  • A Zorba XQC_Query object is clonable in order to be executed in multiple threads (instead of a XQC_DynamicContext being provided for each execution.
  • Zorba provides an XQC_Item struct to represent items instead of XQC only having an XQC_Sequence struct which provides the accessors for the XDM. Moreover, Zorba provides an item factory to create XQC_Item objects.
  • Zorba makes management facilities available for collections and documents in a Zorba store.
  • Zorba's C API provides an interface and a registration function to write and register external XQuery functions written in C.
To start with, this documentation provides a set of examples that demonstrate some features: