zorba::StaticContext Class Reference

Instances of the class StaticContext containt the information that is available at the time the query is compiled. More...

#include <zorba/static_context.h>

List of all members.

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.


Detailed Description

Instances of the class StaticContext containt the information that is available at the time the query is compiled.

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.

Examples:

context.cpp.

Definition at line 35 of file static_context.h.


Member Enumeration Documentation

enum zorba::StaticContext::boundary_space_mode_t

Boundary-space policy as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
preserve_space 
strip_space 

Definition at line 64 of file static_context.h.

enum zorba::StaticContext::construction_mode_t

Construction mode as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
preserve_cons 
strip_cons 

Definition at line 68 of file static_context.h.

enum zorba::StaticContext::inherit_mode_t

Inherit part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
inherit_ns 
no_inherit_ns 

Definition at line 55 of file static_context.h.

enum zorba::StaticContext::order_empty_mode_t

Default order for empty sequences as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
empty_greatest 
empty_least 

Definition at line 50 of file static_context.h.

enum zorba::StaticContext::ordering_mode_t

Ordering mode as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
ordered 
unordered 

Definition at line 45 of file static_context.h.

enum zorba::StaticContext::preserve_mode_t

Preserve part of the Copy-namespace mode as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
preserve_ns 
no_preserve_ns 

Definition at line 60 of file static_context.h.

enum zorba::StaticContext::xpath1_0compatib_mode_t

XPath 1.0 compatibility mode as defined in http://www.w3.org/TR/xquery/#static_context.

Enumerator:
xpath2_0 
xpath1_0 

Definition at line 41 of file static_context.h.


Constructor & Destructor Documentation

virtual zorba::StaticContext::~StaticContext (  )  [inline, virtual]

Destructor.

Definition at line 72 of file static_context.h.


Member Function Documentation

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

Parameters:
aURI the URI of the collation.
Returns:
true if the collation was added, false otherwise (e.g. the URI was not a valid collation URI).
Exceptions:
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.

Parameters:
aPrefix the prefix String.
aURI the URI String.
Returns:
true if the pair was added to the set of statically known namespaces, false otherwise.
Exceptions:
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]

Get the base URI.

Returns:
String the base URI.

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)

Returns:
boundary_space_mode_t the boundary space policy.

virtual construction_mode_t zorba::StaticContext::getConstructionMode (  )  const [pure virtual]

Get the construction mode.

(see http://www.w3.org/TR/xquery/#static_context)

Returns:
construction_mode_t the construction mode.

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)

Returns:
aPreserve the preserve mode.

aInherit the inherit mode.

virtual String zorba::StaticContext::getDefaultCollation (  )  const [pure virtual]

Get the URI of the default collation.

Returns:
String the URI of the default collation.

virtual String zorba::StaticContext::getDefaultElementAndTypeNamespace (  )  const [pure virtual]

Get the default element and type namespace URI.

Returns:
String the URI for the default element and type namespace.
Exceptions:
ZorbaException if an error occured.

virtual String zorba::StaticContext::getDefaultFunctionNamespace (  )  const [pure virtual]

Get the default function namespace.

Returns:
String the URI of the default function namespace. ErrorHandler has been registered.
Exceptions:
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)

Returns:
order_empty_mode_t the ordering mode.

virtual String zorba::StaticContext::getNamespaceURIByPrefix ( const String aPrefix  )  const [pure virtual]

Get the namespace URI for a given prefix.

Parameters:
aPrefix the prefix for which to retrieve the namespace URI.
Returns:
String the URI for the given prefix or an empty String if no URI could be found for the given prefix and an ErrorHandler has been registered.
Exceptions:
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)

Returns:
ordering_mode_t the ordering mode.
Examples:
context.cpp.

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)

Returns:
xpath1_0compatib_mode_t the XPath 1.0 compatibility mode.

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.

Parameters:
aExternalFunction the stateless external function.
Returns:
true if the function has been set, false otherwise.

virtual bool zorba::StaticContext::setBaseURI ( const String aBaseURI  )  [pure virtual]

Set the base URI.

(see http://www.w3.org/TR/xquery/#static_context)

Parameters:
aBaseURI the base URI as String.
Returns:
true if the base URI has been set, false otherwise.

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)

Parameters:
aMode the boundary space policy.
Returns:
true if the mode was set, false otherwise.

virtual bool zorba::StaticContext::setConstructionMode ( construction_mode_t  aMode  )  [pure virtual]

Set the construction mode.

(see http://www.w3.org/TR/xquery/#static_context)

Parameters:
aMode the construction mode.
Returns:
true if the mode was set, false otherwise.

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)

Parameters:
aPreserve the preserve mode.
aInherit the inherit mode.
Returns:
true if the mode was set, false otherwise.

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)

Parameters:
aURI URI of the default collation.
Returns:
true if the default collation URI has been set, false otherwise.
Exceptions:
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).

Parameters:
aURI of the default element and type namespace URI.
Returns:
true if the default element and type namespace URI has been set, false otherwise if an ErrorHandler has been registered.
Exceptions:
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).

Parameters:
aURI of the default function namespace.
Returns:
true if the default function namespace URI has been set, false otherwise if an ErrorHandler has been registered.
Exceptions:
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)

Parameters:
aMode the default order for the empty sequence.
Returns:
true if the mode was set, false otherwise.

virtual bool zorba::StaticContext::setOrderingMode ( ordering_mode_t  aMode  )  [pure virtual]

Set the ordering mode.

(see http://www.w3.org/TR/xquery/#static_context)

Parameters:
aMode the ordering mode.
Returns:
true if the mode was set, false otherwise.

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)

Parameters:
aMode the XPath 1.0 compatibility mode.
Returns:
true if the mode was set, false otherwise.


The documentation for this class was generated from the following file: