> The XQuery Processor
#include <zorba/static_context.h>
Public Types | |
| enum | boundary_space_mode_t { preserve_space, strip_space } |
| Boundary-space policy as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | construction_mode_t { preserve_cons, strip_cons } |
| Construction mode as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | inherit_mode_t { inherit_ns, no_inherit_ns } |
| Inherit part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | order_empty_mode_t { empty_greatest, empty_least } |
| Default order for empty sequences as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | ordering_mode_t { ordered, unordered } |
| Ordering mode as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | preserve_mode_t { preserve_ns, no_preserve_ns } |
| Preserve part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
| enum | xpath1_0compatib_mode_t { xpath2_0, xpath1_0 } |
| XPath 1.0 compatibility mode as defined in http://www.w3.org/TR/xquery/#static_context. More... | |
Public Member Functions | |
| virtual bool | addCollation (const String &aURI)=0 |
| Adds a collation URI. | |
| virtual bool | addNamespace (const String &aPrefix, const String &aURI)=0 |
| Add a pair (prefix, URI) to the statically known namespaces that are available during query compilation. | |
| virtual StaticContext_t | createChildContext () const =0 |
| Create a child static context, i.e. | |
| virtual String | getBaseURI () const =0 |
| Get the base URI. | |
| virtual boundary_space_mode_t | getBoundarySpacePolicy () const =0 |
| Get the boundary space policy. | |
| virtual construction_mode_t | getConstructionMode () const =0 |
| Get the construction mode. | |
| virtual void | getCopyNamespacesMode (preserve_mode_t &aPreserve, inherit_mode_t &aInherit) const =0 |
| Get the copy namespace mode. | |
| virtual String | getDefaultCollation () const =0 |
| Get the URI of the default collation. | |
| virtual String | getDefaultElementAndTypeNamespace () const =0 |
| Get the default element and type namespace URI. | |
| virtual String | getDefaultFunctionNamespace () const =0 |
| Get the default function namespace. | |
| virtual order_empty_mode_t | getDefaultOrderForEmptySequences () const =0 |
| Get the default order for the empty sequence. | |
| virtual String | getNamespaceURIByPrefix (const String &aPrefix) const =0 |
| Get the namespace URI for a given prefix. | |
| virtual ordering_mode_t | getOrderingMode () const =0 |
| Get the ordering mode. | |
| virtual xpath1_0compatib_mode_t | getXPath1_0CompatibMode () const =0 |
| Get the XPath 1.0 compatibility mode. | |
| virtual bool | registerStatelessExternalFunction (StatelessExternalFunction *aExternalFunction)=0 |
| Register a stateless external function. | |
| virtual bool | setBaseURI (const String &aBaseURI)=0 |
| Set the base URI. | |
| virtual bool | setBoundarySpacePolicy (boundary_space_mode_t aMode)=0 |
| Set the boundary space policy. | |
| virtual bool | setConstructionMode (construction_mode_t aMode)=0 |
| Set the construction mode. | |
| virtual bool | setCopyNamespacesMode (preserve_mode_t aPreserve, inherit_mode_t aInherit)=0 |
| Set the copy namespace mode. | |
| virtual bool | setDefaultCollation (const String &aURI)=0 |
| Set the URI of the default collation. | |
| virtual bool | setDefaultElementAndTypeNamespace (const String &aURI)=0 |
| Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context). | |
| virtual bool | setDefaultFunctionNamespace (const String &aURI)=0 |
| Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context). | |
| virtual bool | setDefaultOrderForEmptySequences (order_empty_mode_t aMode)=0 |
| Set the default order for the empty sequence. | |
| virtual bool | setOrderingMode (ordering_mode_t aMode)=0 |
| Set the ordering mode. | |
| virtual bool | setXPath1_0CompatibMode (xpath1_0compatib_mode_t aMode)=0 |
| Set the XPath 1.0 compatibility mode. | |
| virtual | ~StaticContext () |
| Destructor. | |
This class contains the information that is defined in the XQuery specification (see http://www.w3.org/TR/xquery/#static_context).
A StaticContext can be created by calling Zorba::createStaticContext and then be passed to the Zorba::compileQuery or XQuery::compile functions. If no static context has been passed to any of these functions, a default static context is used. It can be accessed by calling XQuery::getStaticContext on a compiled XQuery object.
Definition at line 35 of file static_context.h.
Boundary-space policy as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 64 of file static_context.h.
Construction mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 68 of file static_context.h.
Inherit part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 55 of file static_context.h.
Default order for empty sequences as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 50 of file static_context.h.
Ordering mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 45 of file static_context.h.
Preserve part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 60 of file static_context.h.
XPath 1.0 compatibility mode as defined in http://www.w3.org/TR/xquery/#static_context.
Definition at line 41 of file static_context.h.
| virtual zorba::StaticContext::~StaticContext | ( | ) | [inline, virtual] |
| virtual bool zorba::StaticContext::addCollation | ( | const String & | aURI | ) | [pure virtual] |
Adds a collation URI.
The URI specifies the locale and collation strength of the collation that is added. A valid collation URI must begin with http://www.flworfound.org/collations/. This prefix is followed by a collation strength (i.e. PRIMARY, SECONDARY, TERTIARY, QUATTERNARY, or IDENTICAL) followed by a '/'. After the strength a lower-case two- or three-letter ISO-639 language code must follow. The URI may end with an upper-case two-letter ISO-3166. For example, http://www.flworfound.org/collations/PRIMARY/en/US specifies an english language with US begin the country..
Internally, ICU is used for comparing strings. For detailed description see http://www.icu-project.org/apiref/icu4c/classCollator.html and http://www.icu-project.org/apiref/icu4c/classLocale.html
| aURI | the URI of the collation. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::addNamespace | ( | const String & | aPrefix, | |
| const String & | aURI | |||
| ) | [pure virtual] |
Add a pair (prefix, URI) to the statically known namespaces that are available during query compilation.
See http://www.w3.org/TR/xquery/#static_context.
| ZorbaException | if an error occures. |
| virtual StaticContext_t zorba::StaticContext::createChildContext | ( | ) | const [pure virtual] |
Create a child static context, i.e.
a context with the same information, of the given static context.
A child static context carries the same context as it's parent but can override any information.
| virtual String zorba::StaticContext::getBaseURI | ( | ) | const [pure virtual] |
| virtual boundary_space_mode_t zorba::StaticContext::getBoundarySpacePolicy | ( | ) | const [pure virtual] |
Get the boundary space policy.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual construction_mode_t zorba::StaticContext::getConstructionMode | ( | ) | const [pure virtual] |
Get the construction mode.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual void zorba::StaticContext::getCopyNamespacesMode | ( | preserve_mode_t & | aPreserve, | |
| inherit_mode_t & | aInherit | |||
| ) | const [pure virtual] |
Get the copy namespace mode.
(see http://www.w3.org/TR/xquery/#static_context)
aInherit the inherit mode.
| virtual String zorba::StaticContext::getDefaultCollation | ( | ) | const [pure virtual] |
| virtual String zorba::StaticContext::getDefaultElementAndTypeNamespace | ( | ) | const [pure virtual] |
Get the default element and type namespace URI.
| ZorbaException | if an error occured. |
| virtual String zorba::StaticContext::getDefaultFunctionNamespace | ( | ) | const [pure virtual] |
Get the default function namespace.
| ZorbaException | if an error occured. |
| virtual order_empty_mode_t zorba::StaticContext::getDefaultOrderForEmptySequences | ( | ) | const [pure virtual] |
Get the default order for the empty sequence.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual String zorba::StaticContext::getNamespaceURIByPrefix | ( | const String & | aPrefix | ) | const [pure virtual] |
Get the namespace URI for a given prefix.
| aPrefix | the prefix for which to retrieve the namespace URI. |
| ZorbaException | if an error occured (e.g. no URI could be found for the given prefix). |
| virtual ordering_mode_t zorba::StaticContext::getOrderingMode | ( | ) | const [pure virtual] |
Get the ordering mode.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual xpath1_0compatib_mode_t zorba::StaticContext::getXPath1_0CompatibMode | ( | ) | const [pure virtual] |
Get the XPath 1.0 compatibility mode.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual bool zorba::StaticContext::registerStatelessExternalFunction | ( | StatelessExternalFunction * | aExternalFunction | ) | [pure virtual] |
Register a stateless external function.
Register an external function that can be called within a query. The caller keeps the ownership of the StatelessExternalFunction object passed to this function.
| aExternalFunction | the stateless external function. |
| virtual bool zorba::StaticContext::setBaseURI | ( | const String & | aBaseURI | ) | [pure virtual] |
Set the base URI.
(see http://www.w3.org/TR/xquery/#static_context)
| aBaseURI | the base URI as String. |
| virtual bool zorba::StaticContext::setBoundarySpacePolicy | ( | boundary_space_mode_t | aMode | ) | [pure virtual] |
Set the boundary space policy.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the boundary space policy. |
| virtual bool zorba::StaticContext::setConstructionMode | ( | construction_mode_t | aMode | ) | [pure virtual] |
Set the construction mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the construction mode. |
| virtual bool zorba::StaticContext::setCopyNamespacesMode | ( | preserve_mode_t | aPreserve, | |
| inherit_mode_t | aInherit | |||
| ) | [pure virtual] |
Set the copy namespace mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aPreserve | the preserve mode. | |
| aInherit | the inherit mode. |
| virtual bool zorba::StaticContext::setDefaultCollation | ( | const String & | aURI | ) | [pure virtual] |
Set the URI of the default collation.
(see http://www.w3.org/TR/xquery/#static_context)
| aURI | URI of the default collation. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultElementAndTypeNamespace | ( | const String & | aURI | ) | [pure virtual] |
Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context).
| aURI | of the default element and type namespace URI. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultFunctionNamespace | ( | const String & | aURI | ) | [pure virtual] |
Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context).
| aURI | of the default function namespace. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultOrderForEmptySequences | ( | order_empty_mode_t | aMode | ) | [pure virtual] |
Set the default order for the empty sequence.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the default order for the empty sequence. |
| virtual bool zorba::StaticContext::setOrderingMode | ( | ordering_mode_t | aMode | ) | [pure virtual] |
Set the ordering mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the ordering mode. |
| virtual bool zorba::StaticContext::setXPath1_0CompatibMode | ( | xpath1_0compatib_mode_t | aMode | ) | [pure virtual] |
Set the XPath 1.0 compatibility mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the XPath 1.0 compatibility mode. |