Public Member Functions | Protected Attributes
zorba::StaticContext Class Reference

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

#include <zorba/static_context.h>

Inheritance diagram for zorba::StaticContext:
Inheritance graph
[legend]
Collaboration diagram for zorba::StaticContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void 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.
void addReference () const
virtual void clearBaseURI ()=0
 Clears the base URI and sets it to undefined state.
virtual bool containsFunction (const String &aFnNameUri, const String &aFnNameLocal, int arity) const =0
 Check if a function with the given name and arity are registered in the context.
virtual StaticContext_t createChildContext () const =0
 Create a child static context, i.e.
virtual void declareOption (const Item &aQName, const String &aOptionValue)=0
 Declare an option (same as using declare option in XQuery)
virtual void disableFunction (const Function_t &aFunction)=0
virtual void disableFunction (const Item &aQName, int arity)=0
virtual Item fetch (const String &aURI) const =0
 Fetches an resource refered to by the given URI.
virtual Item fetch (const String &aURI, const String &aEntityKind) const =0
 Fetches an resource refered to by the given URI.
virtual Item fetch (const String &aURI, const String &aEntityKind, const String &aEncoding) const =0
 Fetches an resource refered to by the given URI.
virtual Item fetchBinary (const String &aURI) const =0
 Fetches an resource refered to by the given URI and returns it as a base64binary.
virtual Item fetchBinary (const String &aURI, const String &aEntityKind) const =0
 Fetches an resource refered to by the given URI and returns it as a base64binary.
virtual void findFunctions (const Item &aQName, std::vector< Function_t > &aFunctions) const =0
virtual void free ()
virtual audit::EventgetAuditEvent () const =0
 gets the audit event that is populated during execution
virtual String getBaseURI () const =0
 Get the base URI.
virtual boundary_space_mode_t getBoundarySpacePolicy () const =0
 Get the boundary space policy.
virtual TypeIdentifier_t getCollectionType (const String &aCollectionUri) const =0
 Get the type of a statically known collection.
virtual construction_mode_t getConstructionMode () const =0
 Get the construction mode.
virtual TypeIdentifier_t getContextItemStaticType () const =0
 Fetch the type of the context item.
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 TypeIdentifier_t getDocumentType (const String &aDocUri) const =0
 Get the type of a statically known document.
virtual void getExternalVariables (Iterator_t &aVarsIter) const =0
 Returns the QName of all external variables within the static context.
virtual void getFullLibPath (std::vector< String > &aLibPath) const =0
 Return the URI lookup path (list of filesystem directories) for this static context and all its parents.
virtual void getFullModulePaths (std::vector< String > &aFullModulePaths) const =0
 Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context and all its parents.
virtual void getFullURIPath (std::vector< String > &aURIPath) const =0
 Return the URI lookup path (list of filesystem directories) for this static context and all its parents.
virtual void getFunctionAnnotations (const Item &aQName, int arity, std::vector< Annotation_t > &aAnnotations) const =0
virtual void getFunctions (std::vector< Function_t > &aFunctions) const =0
 Get all functions declared in the given static context.
virtual void getFunctions (const String &aFnNameUri, uint32_t arity, std::vector< Function_t > &aFunctions) const =0
 Get all functions with a specified namespace and airty\ declared in the given static context.
virtual void getLibPath (std::vector< String > &aLibPath) const =0
 Return the URI lookup path (list of filesystem directories) for this static context.
virtual void getModulePaths (std::vector< String > &aModulePaths) const =0
 Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context.
virtual void getNamespaceBindings (NsBindings &aBindings) const =0
 Get the list of all namespace bindings (prefix, uri) declared in this and its parent static contexts.
virtual String getNamespaceURIByPrefix (const String &aPrefix) const =0
 Get the namespace URI for a given prefix.
virtual bool getOption (const Item &aQName, String &aOptionValue) const =0
 Get an option that was declared using the declare option syntax.
virtual ordering_mode_t getOrderingMode () const =0
 Get the ordering mode.
long getRefCount () const
virtual validation_mode_t getRevalidationMode () const =0
 Get the revalidation mode.
virtual StaticCollectionManagergetStaticCollectionManager () const =0
 Returns a CollectionManager responsible for all collections which are statically declared in this static context.
virtual void getURIPath (std::vector< String > &aURIPath) const =0
 Return the URI lookup path (list of filesystem directories) for this static context.
virtual xpath1_0compatib_mode_t getXPath1_0CompatibMode () const =0
 Get the XPath 1.0 compatibility mode.
virtual xquery_version_t getXQueryVersion () const =0
 Get the XQuery processing mode (version 1.0 or 3.0).
virtual ItemSequence_t invoke (const Item &aQName, const std::vector< ItemSequence_t > &aArgs) const =0
 Invokes the XQuery function with the given name and the given parameters.
virtual void loadProlog (const String &, const Zorba_CompilerHints_t &hints)=0
 Loads the declarations and definitions of a given XQuery prolog into this static context.
virtual bool registerModule (ExternalModule *aModule)=0
 Register a module providing access to external functions.
virtual void registerURIMapper (URIMapper *aMapper)=0
 Register a URI Mapper which will transform a given URI into several alternate potential URIs.
virtual void registerURLResolver (URLResolver *aResolver)=0
 Register a URL Resolver which will transform a given URL into a Resource.
void removeReference ()
virtual void resetTraceStream ()=0
 Resets the output stream that is used by the fn:trace function to std::cerr.
virtual String resolve (const String &aRelativeUri) const =0
 Resolves the given URI against the value of the base-uri property from the static context.
virtual String resolve (const String &aRelativeUri, const String &aBaseUri) const =0
 Resolves the given relative URI against the absolute base URI.
virtual void setAuditEvent (audit::Event *anEvent)=0
 sets the audit event that will be populated during execution
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 void setCollectionType (const String &aCollectionUri, TypeIdentifier_t type)=0
 Set the type of a statically known collection.
virtual bool setConstructionMode (construction_mode_t aMode)=0
 Set the construction mode.
virtual void setContextItemStaticType (TypeIdentifier_t type)=0
 Set the type of the context item.
virtual bool setCopyNamespacesMode (preserve_mode_t aPreserve, inherit_mode_t aInherit)=0
 Set the copy namespace mode.
virtual void 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 void setDocumentType (const String &aDocUri, TypeIdentifier_t type)=0
 Set the type of a statically known document.
virtual void setLibPath (const std::vector< String > &aLibPath)=0
 Set the library lookup path (list of filesystem directories) for this static context.
virtual void setModulePaths (const std::vector< String > &aModulePaths)=0
 Set the URI and library lookup paths (lists of filesystem directories) for this static context.
virtual bool setOrderingMode (ordering_mode_t aMode)=0
 Set the ordering mode.
virtual void setRevalidationMode (validation_mode_t aMode)=0
 Set the revalidation mode.
virtual void setTraceStream (std::ostream &)=0
 Set the output stream that is used by the fn:trace function.
virtual void setURIPath (const std::vector< String > &aURIPath)=0
 Set the URI lookup path (list of filesystem directories) for this static context.
virtual bool setXPath1_0CompatibMode (xpath1_0compatib_mode_t aMode)=0
 Set the XPath 1.0 compatibility mode.
virtual bool setXQueryVersion (xquery_version_t aMode)=0
 Set the XQuery processing mode (version 1.0 or 3.0).
virtual bool validate (const Item &rootElement, Item &validatedResult, validation_mode_t validationMode=validate_strict) const =0
 Validates this Item.
virtual bool validate (const Item &rootElement, Item &validatedResult, const String &targetNamespace, validation_mode_t validationMode=validate_strict) const =0
 Validates this Item while loading the schema for targetNamespace Note: works only on document or element nodes, otherwise returns false.
virtual bool validateSimpleContent (const String &stringValue, const Item &typeQName, std::vector< Item > &resultList) const =0
 Validates stringValue as XML simple content, i.e.
virtual ~StaticContext ()
 Destructor.

Protected Attributes

unsigned int theRefCount

Detailed Description

Instances of the class StaticContext contain 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.

Note: This class is reference counted. When writing multi-threaded clients, it is the responibility of the client code to synchronize assignments to the SmartPtr holding this object.

Examples:
context.cpp, and external_functions.cpp.

Definition at line 54 of file static_context.h.


Constructor & Destructor Documentation

virtual zorba::StaticContext::~StaticContext ( )
inlinevirtual

Destructor.

Definition at line 59 of file static_context.h.


Member Function Documentation

virtual void 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.zorba-xquery.com/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.zorba-xquery.com/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:
aURIthe URI of the collation.
Exceptions:
ZorbaExceptionif an error occured (e.g. the URI was not a valid collation URI).
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:
aPrefixthe prefix String.
aURIthe URI String.
Returns:
true if the pair was added to the set of statically known namespaces, false otherwise.
Exceptions:
ZorbaExceptionif an error occures.
void zorba::SmartObject::addReference ( ) const
inlineinherited

Definition at line 40 of file smart_ptr.h.

virtual void zorba::StaticContext::clearBaseURI ( )
pure virtual

Clears the base URI and sets it to undefined state.

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

virtual bool zorba::StaticContext::containsFunction ( const String aFnNameUri,
const String aFnNameLocal,
int  arity 
) const
pure virtual

Check if a function with the given name and arity are registered in the context.

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 void zorba::StaticContext::declareOption ( const Item aQName,
const String aOptionValue 
)
pure virtual

Declare an option (same as using declare option in XQuery)

Parameters:
aQNameThe QName of the option to declare.
aOptionValueThe value of the option to declare.
virtual void zorba::StaticContext::disableFunction ( const Function_t aFunction)
pure virtual
virtual void zorba::StaticContext::disableFunction ( const Item aQName,
int  arity 
)
pure virtual
virtual Item zorba::StaticContext::fetch ( const String aURI) const
pure virtual

Fetches an resource refered to by the given URI.

Resolution is done using the URI mappers and resolvers registered in this static context. If no such mappers or resolvers have been registered, the built-in ones are used.

The default EntityKind for resources fetched by this function is "SOME_CONTENT". The default encoding that is used to read the resource is "UTF-8".

Parameters:
aURIthe name of the resource to fetch
Returns:
the fetched resource
virtual Item zorba::StaticContext::fetch ( const String aURI,
const String aEntityKind 
) const
pure virtual

Fetches an resource refered to by the given URI.

Resolution is done using the URI mappers and resolvers registered in this static context. If no such mappers or resolvers have been registered, the built-in ones are used.

The default encoding that is used to read the * resource is "UTF-8".

Parameters:
aURIthe name of the resource to fetch
aEntityKindthe kind of the entity to fetch (i.e. SOME_CONTENT, SCHEMA, MODULE, THESAURUS, or STOP_WORDS)
Returns:
the fetched resource
virtual Item zorba::StaticContext::fetch ( const String aURI,
const String aEntityKind,
const String aEncoding 
) const
pure virtual

Fetches an resource refered to by the given URI.

Resolution is done using the URI mappers and resolvers registered in this static context. If no such mappers or resolvers have been registered, the built-in ones are used.

Parameters:
aURIthe name of the resource to fetch
aEncodingthe encoding to use when reading the resource.
aEntityKindthe kind of the entity to fetch (i.e. SOME_CONTENT, SCHEMA, MODULE, THESAURUS, or STOP_WORDS)
Returns:
the fetched resource
virtual Item zorba::StaticContext::fetchBinary ( const String aURI) const
pure virtual

Fetches an resource refered to by the given URI and returns it as a base64binary.

Resolution is done using the URI mappers and resolvers registered in this static context. If no such mappers or resolvers have been registered, the built-in ones are used.

The default EntityKind for resources fetched by this function is "SOME_CONTENT".

Parameters:
aURIthe name of the resource to fetch
Returns:
the fetched resource
virtual Item zorba::StaticContext::fetchBinary ( const String aURI,
const String aEntityKind 
) const
pure virtual

Fetches an resource refered to by the given URI and returns it as a base64binary.

Resolution is done using the URI mappers and resolvers registered in this static context. If no such mappers or resolvers have been registered, the built-in ones are used.

Parameters:
aURIthe name of the resource to fetch
aEntityKindthe kind of the entity to fetch (i.e. SOME_CONTENT, SCHEMA, MODULE, THESAURUS, or STOP_WORDS)
Returns:
the fetched resource
virtual void zorba::StaticContext::findFunctions ( const Item aQName,
std::vector< Function_t > &  aFunctions 
) const
pure virtual
virtual void zorba::SmartObject::free ( )
virtualinherited
virtual audit::Event* zorba::StaticContext::getAuditEvent ( ) const
pure virtual

gets the audit event that is populated during execution

Returns:
the audit event
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 TypeIdentifier_t zorba::StaticContext::getCollectionType ( const String aCollectionUri) const
pure virtual

Get the type of a statically known collection.

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 TypeIdentifier_t zorba::StaticContext::getContextItemStaticType ( ) const
pure virtual

Fetch the type of the context item.

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:
ZorbaExceptionif 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. DiagnosticHandler has been registered.
Exceptions:
ZorbaExceptionif 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 TypeIdentifier_t zorba::StaticContext::getDocumentType ( const String aDocUri) const
pure virtual

Get the type of a statically known document.

virtual void zorba::StaticContext::getExternalVariables ( Iterator_t aVarsIter) const
pure virtual

Returns the QName of all external variables within the static context.

Parameters:
aVarsIteriterator to store the results.
Exceptions:
ZorbaExceptionif an error occured.
virtual void zorba::StaticContext::getFullLibPath ( std::vector< String > &  aLibPath) const
pure virtual

Return the URI lookup path (list of filesystem directories) for this static context and all its parents.

virtual void zorba::StaticContext::getFullModulePaths ( std::vector< String > &  aFullModulePaths) const
pure virtual

Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context and all its parents.

Deprecated:
Use StaticContext::getFullURIPath() and StaticContext::getFullLibPath().
virtual void zorba::StaticContext::getFullURIPath ( std::vector< String > &  aURIPath) const
pure virtual

Return the URI lookup path (list of filesystem directories) for this static context and all its parents.

virtual void zorba::StaticContext::getFunctionAnnotations ( const Item aQName,
int  arity,
std::vector< Annotation_t > &  aAnnotations 
) const
pure virtual
virtual void zorba::StaticContext::getFunctions ( std::vector< Function_t > &  aFunctions) const
pure virtual

Get all functions declared in the given static context.

Returns:
aFunctions all of the said functions
virtual void zorba::StaticContext::getFunctions ( const String aFnNameUri,
uint32_t  arity,
std::vector< Function_t > &  aFunctions 
) const
pure virtual

Get all functions with a specified namespace and airty\ declared in the given static context.

Parameters:
aFnNameUrithe namespace for the functions to return
aritythe arity for the functions to return
aFunctionsall of the said functions
virtual void zorba::StaticContext::getLibPath ( std::vector< String > &  aLibPath) const
pure virtual

Return the URI lookup path (list of filesystem directories) for this static context.

Returns any values set by StaticContext::setLibPath() on this static context. To return the full library lookup path for this static context and all its parents (usually most useful), call StaticContext::getFullLibPath().

virtual void zorba::StaticContext::getModulePaths ( std::vector< String > &  aModulePaths) const
pure virtual

Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context.

Deprecated:

Use StaticContext::getURIPath() and StaticContext::getLibPath().

Use StaticContext::getURIPath() and StaticContext::getLibPath().

Returns any values set by StaticContext::setLibPath() and/or StaticContext::setURIPath()
on this static context.
virtual void zorba::StaticContext::getNamespaceBindings ( NsBindings aBindings) const
pure virtual

Get the list of all namespace bindings (prefix, uri) declared in this and its parent static contexts.

Parameters:
aBindingsthe bindings are added to this list
virtual String zorba::StaticContext::getNamespaceURIByPrefix ( const String aPrefix) const
pure virtual

Get the namespace URI for a given prefix.

Parameters:
aPrefixthe 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 DiagnosticHandler has been registered.
Exceptions:
ZorbaExceptionif an error occured (e.g. no URI could be found for the given prefix).
Deprecated:
This function is deprecated. Use getNamespaceBindings instead.
Examples:
external_functions.cpp.
virtual bool zorba::StaticContext::getOption ( const Item aQName,
String aOptionValue 
) const
pure virtual

Get an option that was declared using the declare option syntax.

Parameters:
aQNameThe QName of the option to get.
aOptionValueThe value of the option if found.
Returns:
true if the option was found, false otherwise.
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.
long zorba::SmartObject::getRefCount ( ) const
inlineinherited

Definition at line 38 of file smart_ptr.h.

virtual validation_mode_t zorba::StaticContext::getRevalidationMode ( ) const
pure virtual

Get the revalidation mode.

Returns:
the revalidation mode.
virtual StaticCollectionManager* zorba::StaticContext::getStaticCollectionManager ( ) const
pure virtual

Returns a CollectionManager responsible for all collections which are statically declared in this static context.

The collection manager provides a set of functions for managing collections and their contents.

Returns:
The collection manager responsible for managing collections of this context.
virtual void zorba::StaticContext::getURIPath ( std::vector< String > &  aURIPath) const
pure virtual

Return the URI lookup path (list of filesystem directories) for this static context.

Returns any values set by StaticContext::setURIPath() on this static context. To return the full URI lookup path for this static context and all its parents (usually most useful), call StaticContext::getFullURIPath().

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 xquery_version_t zorba::StaticContext::getXQueryVersion ( ) const
pure virtual

Get the XQuery processing mode (version 1.0 or 3.0).

Returns:
xquery_version_t the XQuery version processing mode.
virtual ItemSequence_t zorba::StaticContext::invoke ( const Item aQName,
const std::vector< ItemSequence_t > &  aArgs 
) const
pure virtual

Invokes the XQuery function with the given name and the given parameters.

Note that the function to be invoked needs to be declared in this static context. In order to declare a function in the static context, the loadProlog method of this class can be used.

Also note that if the function to be invoked is an updating function, its resulting pending update list is implicitly applied by this function.

Parameters:
aQNamethe name of the function to be invoked
aArgsa vector of ItemSequences. One entry in the vector corresponds to one argument that is passed to the function.
Returns:
The result of the function that is invoked. If the function to be invoked is an updating function, the resulting item sequence is empty.
virtual void zorba::StaticContext::loadProlog ( const String ,
const Zorba_CompilerHints_t hints 
)
pure virtual

Loads the declarations and definitions of a given XQuery prolog into this static context.

This function compiles the prolog passed as first parameter and loads all declarations and definitions into this static context.

The static context extended by this prolog can then be used for creating a compiling a new query.

A StaticException is raised if the prolog could not be compiled or if the prolog does not contain valid declarations (e.g. duplicate declarations).

virtual bool zorba::StaticContext::registerModule ( ExternalModule aModule)
pure virtual

Register a module providing access to external functions.

Register a module that provides access to external functions. The caller keeps the ownership of the Module and the StatelessExternalFunction objects passed to this function.

Parameters:
aModulethe module object
Returns:
true if the module has been set, false otherwise.
virtual void zorba::StaticContext::registerURIMapper ( URIMapper aMapper)
pure virtual

Register a URI Mapper which will transform a given URI into several alternate potential URIs.

QQQ doc

virtual void zorba::StaticContext::registerURLResolver ( URLResolver aResolver)
pure virtual

Register a URL Resolver which will transform a given URL into a Resource.

QQQ doc

void zorba::SmartObject::removeReference ( )
inlineinherited

Definition at line 42 of file smart_ptr.h.

virtual void zorba::StaticContext::resetTraceStream ( )
pure virtual

Resets the output stream that is used by the fn:trace function to std::cerr.

virtual String zorba::StaticContext::resolve ( const String aRelativeUri) const
pure virtual

Resolves the given URI against the value of the base-uri property from the static context.

Parameters:
aRelativeUriThe relative URI to be resolved.
virtual String zorba::StaticContext::resolve ( const String aRelativeUri,
const String aBaseUri 
) const
pure virtual

Resolves the given relative URI against the absolute base URI.

Parameters:
aRelativeUriThe relative URI to be resolved.
aBaseUriThe absolute URI against which the resolving is performed.
virtual void zorba::StaticContext::setAuditEvent ( audit::Event anEvent)
pure virtual

sets the audit event that will be populated during execution

Parameters:
anEventthe audit event
virtual bool zorba::StaticContext::setBaseURI ( const String aBaseURI)
pure virtual

Set the base URI.

    (see http://www.w3.org/TR/xquery/#static_context)
Parameters:
aBaseURIthe 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:
aModethe boundary space policy.
Returns:
true if the mode was set, false otherwise.
virtual void zorba::StaticContext::setCollectionType ( const String aCollectionUri,
TypeIdentifier_t  type 
)
pure virtual

Set the type of a statically known collection.

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:
aModethe construction mode.
Returns:
true if the mode was set, false otherwise.
virtual void zorba::StaticContext::setContextItemStaticType ( TypeIdentifier_t  type)
pure virtual

Set the type of the context item.

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:
aPreservethe preserve mode.
aInheritthe inherit mode.
Returns:
true if the mode was set, false otherwise.
virtual void 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:
aURIURI of the default collation.
Exceptions:
ZorbaExceptionif an error occured (e.g., the URI does not identify a collation among the statically known collations.
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:
aURIof the default element and type namespace URI.
Returns:
true if the default element and type namespace URI has been set, false otherwise if an DiagnosticHandler has been registered.
Exceptions:
ZorbaExceptionif 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:
aURIof the default function namespace.
Returns:
true if the default function namespace URI has been set, false otherwise if an DiagnosticHandler has been registered.
Exceptions:
ZorbaExceptionif 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:
aModethe default order for the empty sequence.
Returns:
true if the mode was set, false otherwise.
virtual void zorba::StaticContext::setDocumentType ( const String aDocUri,
TypeIdentifier_t  type 
)
pure virtual

Set the type of a statically known document.

virtual void zorba::StaticContext::setLibPath ( const std::vector< String > &  aLibPath)
pure virtual

Set the library lookup path (list of filesystem directories) for this static context.

Queries which import modules that have external function implementations will look for the implementation of those functions (shared libraries) in these directories.

virtual void zorba::StaticContext::setModulePaths ( const std::vector< String > &  aModulePaths)
pure virtual

Set the URI and library lookup paths (lists of filesystem directories) for this static context.

Note that calling this method will override any values previously passed to StaticContext::setURIPath() and StaticContext::setLibPath().

Deprecated:
Use StaticContext::setURIPath() and StaticContext::setLibPath().

Convenience method which adds the listed directories to both the URI path and Library path for this static context.

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:
aModethe ordering mode.
Returns:
true if the mode was set, false otherwise.
virtual void zorba::StaticContext::setRevalidationMode ( validation_mode_t  aMode)
pure virtual

Set the revalidation mode.

Parameters:
aModethe revalidation mode.
virtual void zorba::StaticContext::setTraceStream ( std::ostream &  )
pure virtual

Set the output stream that is used by the fn:trace function.

Sets the output stream that is used by the fn:trace function to the given output stream. The default stream is std::cerr.

virtual void zorba::StaticContext::setURIPath ( const std::vector< String > &  aURIPath)
pure virtual

Set the URI lookup path (list of filesystem directories) for this static context.

Queries which resolve URIs (for instance, importing modules or schemas) will look in these directories.

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:
aModethe XPath 1.0 compatibility mode.
Returns:
true if the mode was set, false otherwise.
virtual bool zorba::StaticContext::setXQueryVersion ( xquery_version_t  aMode)
pure virtual

Set the XQuery processing mode (version 1.0 or 3.0).

Parameters:
aModethe XQuery version.
Returns:
true if the version was set, false otherwise.
virtual bool zorba::StaticContext::validate ( const Item rootElement,
Item validatedResult,
validation_mode_t  validationMode = validate_strict 
) const
pure virtual

Validates this Item.

Note: works only on document and element nodes, otherwise returns false.

Parameters:
rootElementthe root of the tree beeing validated
validatedResultthe result of the validation
validationModeValidation mode: default value is validate_strict
Returns:
true if validation is correct, false if validation is disabled, throws errors if validation fails
Exceptions:
ZorbaExceptionif any validation error occured
virtual bool zorba::StaticContext::validate ( const Item rootElement,
Item validatedResult,
const String targetNamespace,
validation_mode_t  validationMode = validate_strict 
) const
pure virtual

Validates this Item while loading the schema for targetNamespace Note: works only on document or element nodes, otherwise returns false.

Parameters:
rootElementthe root of the tree beeing validated
validatedResultthe result of the validation
targetNamespacethe expected namespace of root of the tree beeing validated ???
validationModeValidation mode: default value is validate_strict
Returns:
true if validation is correct, false if validation is disabled, throws errors if validation fails
Exceptions:
ZorbaExceptionif any validation error occured
virtual bool zorba::StaticContext::validateSimpleContent ( const String stringValue,
const Item typeQName,
std::vector< Item > &  resultList 
) const
pure virtual

Validates stringValue as XML simple content, i.e.

the text value of attributes or text only element content.

Parameters:
stringValuethe value to be validated
typeQName
resultListthe result of the validation, a vector of atomic Items
Returns:
true if validation is correct, false if validation is disabled, throws errors if validation fails
Exceptions:
ZorbaExceptionif any validation error occured

Member Data Documentation

unsigned int zorba::SmartObject::theRefCount
mutableprotectedinherited

Definition at line 27 of file smart_ptr.h.


The documentation for this class was generated from the following file:
blog comments powered by Disqus