> The XQuery Processor
#include <zorba/zorbac.h>
Data Fields | |
| XQUERY_ERROR(* | apply_updates )(XQC_Query query) |
| Applies the updates declared in the query represented by the XQC_Query object. | |
| void * | data |
| for internal use only | |
| XQUERY_ERROR(* | execute )(XQC_Query query, FILE *file) |
| Executes the query represented by the XQC_Query object and prints the serialized XML output to the given FILE pointer. | |
| void(* | free )(XQC_Query query) |
| Called to free the resources associated with the XQC_Query. | |
| XQUERY_ERROR(* | get_dynamic_context )(XQC_Query query, XQC_DynamicContext_Ref context) |
| This function returns the dynamic context that belongs to this query and is used during query execution. | |
| XQUERY_ERROR(* | get_static_context )(XQC_Query, XQC_StaticContext_Ref context) |
| This function returns the static context that belongs to this query. | |
| int(* | is_update_query )(XQC_Query query) |
| Checks if the query is an updating query. | |
| XQUERY_ERROR(* | sequence )(XQC_Query query, XQC_Sequence_Ref sequence) |
| Executes the query represented by the XQC_Query object. | |
| XQUERY_ERROR(* | serialize_file )(XQC_Query query, const Zorba_SerializerOptions_t *options, FILE *file) |
| Executes the query represented by the XQC_Query object and prints the serialized output to the given FILE pointer. | |
| XQUERY_ERROR(* | serialize_stream )(XQC_Query query, const Zorba_SerializerOptions_t *options, XQC_OutputStream stream) |
| Executes the query represented by the XQC_Query object and writes the serialized output to the given XQC_OutputStream. | |
| void(* | set_error_handler )(XQC_Query query, XQC_ErrorHandler handler) |
Sets the error handler whose error function is called if an error occurs when executing the query. | |
An XQC_Expression object is thread-safe and can be used by multiple threads of execution at the same time.
XQC_Expression objects are created by calling the XQC_Implementation::prepare() or XQC_Implementation::prepare_file() functions. Once created, the user is responsible for freeing the object by calling the free() function. The XQC_Expression object should be freed before the XQC_Implementation object that created it.
ccontext.c, cdatamanager.c, cerror.c, cexternal_functions.c, cserialization.c, and csimple.c.
Definition at line 261 of file zorbac.h.
| XQUERY_ERROR(* XQC_Query_s::apply_updates)(XQC_Query query) |
Applies the updates declared in the query represented by the XQC_Query object.
| query | The XQC_Query that this function pointer is a member of. |
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR | ||
| API0023_CANNOT_SERIALIZE_UPDATE_QUERY | ||
| An | XQuery dynamic or type error (e.g. XPDY*, XPTY*) |
| void* XQC_Query_s::data |
| XQUERY_ERROR(* XQC_Query_s::execute)(XQC_Query query, FILE *file) |
Executes the query represented by the XQC_Query object and prints the serialized XML output to the given FILE pointer.
The user remains responsible for closing the file.
| query | The XQC_Query that this function pointer is a member of. | |
| file | The FILE pointer to print the serialized result to. |
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR | ||
| API0023_CANNOT_SERIALIZE_UPDATE_QUERY | ||
| An | XQuery dynamic or type error (e.g. XPDY*, XPTY*) |
| void(* XQC_Query_s::free)(XQC_Query query) |
Called to free the resources associated with the XQC_Query.
| query | The XQC_Query that this function pointer is a member of. |
| XQUERY_ERROR(* XQC_Query_s::get_dynamic_context)(XQC_Query query, XQC_DynamicContext_Ref context) |
This function returns the dynamic context that belongs to this query and is used during query execution.
The context can be used, for example, to set values of external variables, the default collation, or the current datetime. It is only available if the query has been compiled, otherwise an error is reported. Moreover, the context must not be modified during the execution of a query (i.e. if a ResultIterator is opened). The user is responsible for freeing the XQC_DynamicContext object returned by calling XQC_DynamicContext::free().
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR |
This function returns the static context that belongs to this query.
The static context is only available if the query has been compiled, otherwise an error is reported. The context has all the components and values that have been set by the either the static context that was passed when creating the query and and those that were set in the prolog of the query. Note that after compilation of the query the static context is a read only structure. The user is responsible for freeing the XQC_StaticContext object returned by calling XQC_StaticContext::free().
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR |
| int(* XQC_Query_s::is_update_query)(XQC_Query query) |
Checks if the query is an updating query.
| query | The XQC_Query that this function pionter is a member of. |
| 1 | if query is updating query, else 0 |
Executes the query represented by the XQC_Query object.
An XQC_Sequence object is returned which can be used to examine the results of the query execution. The user is responsible for freeing the XQC_Sequence object returned by calling XQC_Sequence::free().
| query | The XQC_Query that this function pointer is a member of. | |
| [out] | sequence | The newly created XQC_Sequence object. |
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR | ||
| API0024_CANNOT_ITERATE_OVER_UPDATE_QUERY | ||
| An | XQuery dynamic or type error (e.g. XPDY*, XPTY*) |
| XQUERY_ERROR(* XQC_Query_s::serialize_file)(XQC_Query query, const Zorba_SerializerOptions_t *options, FILE *file) |
Executes the query represented by the XQC_Query object and prints the serialized output to the given FILE pointer.
The target format of the serialization is specified by the passed serializer options.
| query | The XQC_Query that this function pointer is a member of. | |
| options | The Zorba_SerializerOptions_t that specifies serializer options. | |
| file | The FILE pointer to print the serialized result to. |
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR | ||
| API0023_CANNOT_SERIALIZE_UPDATE_QUERY | ||
| An | XQuery dynamic or type error (e.g. XPDY*, XPTY*) |
| XQUERY_ERROR(* XQC_Query_s::serialize_stream)(XQC_Query query, const Zorba_SerializerOptions_t *options, XQC_OutputStream stream) |
Executes the query represented by the XQC_Query object and writes the serialized output to the given XQC_OutputStream.
The target format of the serialization is specified by the passed serializer options.
| query | The XQC_Query that this function pointer is a member of. | |
| options | The Zorba_SerializerOptions_t that specifies serializer options. | |
| file | The XQC_OutputStream to print the serialized result to. |
| XQC_NO_ERROR | ||
| XQP0019_INTERNAL_ERROR | ||
| API0023_CANNOT_SERIALIZE_UPDATE_QUERY | ||
| An | XQuery dynamic or type error (e.g. XPDY*, XPTY*) |
| void(* XQC_Query_s::set_error_handler)(XQC_Query query, XQC_ErrorHandler handler) |
Sets the error handler whose error function is called if an error occurs when executing the query.
The user keeps the ownership of this object and is required to freeing the aquired resources.