zorba::StaticContext

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.

#include <zorba/static_context.h>

Inherited by: zorba::SmartObject

Public Functions

virtual voidaddCollation( const String & aURI )
Adds a collation URI.
virtual booladdNamespace( const String & aPrefix, const String & aURI )
Add a pair (prefix, URI) to the statically known namespaces that are available during query compilation.
const inline voidaddReference()
const virtual boolcontainsFunction( const String & aFnNameUri, const String & aFnNameLocal, int arity )
Check if a function with the given name and arity are registered in the context.
const virtual StaticContext_tcreateChildContext()
Create a child static context, i.e.
virtual voiddeclareOption( const Item & aQName, const String & aOptionValue )
Declare an option (same as using declare option in XQuery)
virtual voiddisableFunction( const Function_t & aFunction )
virtual voiddisableFunction( const Item & aQName, int arity )
const virtual voidfindFunctions( const Item & aQName, std::vector< Function_t > & aFunctions )
virtual voidfree()
const virtual audit::Event *getAuditEvent()
gets the audit event that is populated during execution
const virtual StringgetBaseURI()
Get the base URI.
const virtual boundary_space_mode_tgetBoundarySpacePolicy()
Get the boundary space policy.
const virtual TypeIdentifier_tgetCollectionType( const String & aCollectionUri )
Get the type of a statically known collection.
const virtual construction_mode_tgetConstructionMode()
Get the construction mode.
const virtual TypeIdentifier_tgetContextItemStaticType()
Fetch the type of the context item.
const virtual voidgetCopyNamespacesModepreserve_mode_t & aPreserve, inherit_mode_t & aInherit )
Get the copy namespace mode.
const virtual StringgetDefaultCollation()
Get the URI of the default collation.
const virtual StringgetDefaultElementAndTypeNamespace()
Get the default element and type namespace URI.
const virtual StringgetDefaultFunctionNamespace()
Get the default function namespace.
const virtual order_empty_mode_tgetDefaultOrderForEmptySequences()
Get the default order for the empty sequence.
const virtual TypeIdentifier_tgetDocumentType( const String & aDocUri )
Get the type of a statically known document.
const virtual voidgetExternalVariablesIterator_t & aVarsIter )
Returns the QName of all external variables within the static context.
const virtual voidgetFullLibPath( std::vector< String > & aLibPath )
Return the URI lookup path (list of filesystem directories) for this static context and all its parents.
const virtual voidgetFullModulePaths( std::vector< String > & aFullModulePaths )
Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context and all its parents.
const virtual voidgetFullURIPath( std::vector< String > & aURIPath )
Return the URI lookup path (list of filesystem directories) for this static context and all its parents.
const virtual voidgetFunctionAnnotations( const Item & aQName, int arity, std::vector< Annotation_t > & aAnnotations )
const virtual voidgetFunctions( std::vector< Function_t > & aFunctions )
Get all functions declared in the given static context.
const virtual voidgetFunctions( const String & aFnNameUri, uint32_t arity, std::vector< Function_t > & aFunctions )
Get all functions with a specified namespace and airty\ declared in the given static context.
const virtual voidgetLibPath( std::vector< String > & aLibPath )
Return the URI lookup path (list of filesystem directories) for this static context.
const virtual voidgetModulePaths( std::vector< String > & aModulePaths )
Return the union of the URI and library lookup paths (lists of filesystem directories) for this static context.
const virtual voidgetNamespaceBindingsNsBindings & aBindings )
Get the list of all namespace bindings (prefix, uri) declared in this and its parent static contexts.
const virtual StringgetNamespaceURIByPrefix( const String & aPrefix )
Get the namespace URI for a given prefix.
const virtual boolgetOption( const Item & aQName, String & aOptionValue )
Get an option that was declared using the declare option syntax.
const virtual ordering_mode_tgetOrderingMode()
Get the ordering mode.
const inline longgetRefCount()
const virtual validation_mode_tgetRevalidationMode()
Get the revalidation mode.
const virtual StaticCollectionManager *getStaticCollectionManager()
Returns a CollectionManager responsible for all collections which are statically declared in this static context.
const virtual voidgetURIPath( std::vector< String > & aURIPath )
Return the URI lookup path (list of filesystem directories) for this static context.
const virtual xpath1_0compatib_mode_tgetXPath1_0CompatibMode()
Get the XPath 1.0 compatibility mode.
const virtual xquery_version_tgetXQueryVersion()
Get the XQuery processing mode (version 1.0 or 3.0).
const virtual ItemSequence_tinvoke( const Item & aQName, const std::vector< ItemSequence_t > & aArgs )
Invokes the XQuery function with the given name and the given parameters.
virtual voidloadProlog( const String &  , const Zorba_CompilerHints_t & hints )
Loads the declarations and definitions of a given XQuery prolog into this static context.
virtual boolregisterModuleExternalModule * aModule )
Register a module providing access to external functions.
virtual voidregisterURIMapperURIMapper * aMapper )
Register a URI Mapper which will transform a given URI into several alternate potential URIs.
virtual voidregisterURLResolverURLResolver * aResolver )
Register a URL Resolver which will transform a given URL into a Resource.
inline voidremoveReference()
virtual voidresetTraceStream()
Resets the output stream that is used by the fn:trace function to std::cerr.
const virtual Stringresolve( const String & aRelativeUri )
Resolves the given URI against the value of the base-uri property from the static context.
const virtual Stringresolve( const String & aRelativeUri, const String & aBaseUri )
Resolves the given relative URI against the absolute base URI.
virtual voidsetAuditEventaudit::Event * anEvent )
sets the audit event that will be populated during execution
virtual boolsetBaseURI( const String & aBaseURI )
Set the base URI.
virtual boolsetBoundarySpacePolicyboundary_space_mode_t aMode )
Set the boundary space policy.
virtual voidsetCollectionType( const String & aCollectionUri, TypeIdentifier_t type )
Set the type of a statically known collection.
virtual boolsetConstructionModeconstruction_mode_t aMode )
Set the construction mode.
virtual voidsetContextItemStaticTypeTypeIdentifier_t type )
Set the type of the context item.
virtual boolsetCopyNamespacesModepreserve_mode_t aPreserve, inherit_mode_t aInherit )
Set the copy namespace mode.
virtual voidsetDefaultCollation( const String & aURI )
Set the URI of the default collation.
virtual boolsetDefaultElementAndTypeNamespace( const String & aURI )
Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context)
virtual boolsetDefaultFunctionNamespace( const String & aURI )
Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context)
virtual boolsetDefaultOrderForEmptySequencesorder_empty_mode_t aMode )
Set the default order for the empty sequence.
virtual voidsetDocumentType( const String & aDocUri, TypeIdentifier_t type )
Set the type of a statically known document.
virtual voidsetLibPath( const std::vector< String > & aLibPath )
Set the library lookup path (list of filesystem directories) for this static context.
virtual voidsetModulePaths( const std::vector< String > & aModulePaths )
Set the URI and library lookup paths (lists of filesystem directories) for this static context.
virtual boolsetOrderingModeordering_mode_t aMode )
Set the ordering mode.
virtual voidsetRevalidationModevalidation_mode_t aMode )
Set the revalidation mode.
virtual voidsetTraceStream( std::ostream &  )
Set the output stream that is used by the fn:trace function.
virtual voidsetURIPath( const std::vector< String > & aURIPath )
Set the URI lookup path (list of filesystem directories) for this static context.
virtual boolsetXPath1_0CompatibModexpath1_0compatib_mode_t aMode )
Set the XPath 1.0 compatibility mode.
virtual boolsetXQueryVersionxquery_version_t aMode )
Set the XQuery processing mode (version 1.0 or 3.0).
const virtual boolvalidate( const Item & rootElement, Item & validatedResult, validation_mode_t validationMode=validate_strict )
Validates this Item.
const virtual boolvalidate( const Item & rootElement, Item & validatedResult, const String & targetNamespace, validation_mode_t validationMode=validate_strict )
Validates this Item while loading the schema for targetNamespace Note: works only on document or element nodes, otherwise returns false.
const virtual boolvalidateSimpleContent( const String & stringValue, const Item & typeQName, std::vector< Item > & resultList )
Validates stringValue as XML simple content, i.e.
inline virtual ~StaticContext()
Destructor.

Protected Attibutes

unsigned inttheRefCount

Public Functions

addCollation

virtual void addCollation(
    const String & aURI
)

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

aURI

the URI of the collation.

Parameters

if an error occured (e.g. the URI was not a valid collation URI).

addNamespace

virtual bool addNamespace(
    const String & aPrefix,
    const String & aURI
)

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.

Parameters

if an error occures.

addReference

const inline void addReference()

containsFunction

const virtual bool containsFunction(
    const String & aFnNameUri,
    const String & aFnNameLocal,
    int arity
)

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

createChildContext

const virtual StaticContext_t createChildContext()

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.

declareOption

virtual void declareOption(
    const Item & aQName,
    const String & aOptionValue
)

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

Parameters

aQName

The QName of the option to declare.

aOptionValue

The value of the option to declare.

disableFunction

virtual void disableFunction(
    const Function_t & aFunction
)

disableFunction

virtual void disableFunction(
    const Item & aQName,
    int arity
)

findFunctions

const virtual void findFunctions(
    const Item & aQName,
    std::vector< Function_t > & aFunctions
)

free

virtual void free()

getAuditEvent

const virtual audit::Event * getAuditEvent()

gets the audit event that is populated during execution

Returns

the audit event

getBaseURI

const virtual String getBaseURI()

Get the base URI.

Returns

String the base URI.

getBoundarySpacePolicy

const virtual boundary_space_mode_t getBoundarySpacePolicy()

Get the boundary space policy.

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

Returns

boundary_space_mode_t the boundary space policy.

getCollectionType

const virtual TypeIdentifier_t getCollectionType(
    const String & aCollectionUri
)

Get the type of a statically known collection.

getConstructionMode

const virtual construction_mode_t getConstructionMode()

Get the construction mode.

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

Returns

construction_mode_t the construction mode.

getContextItemStaticType

const virtual TypeIdentifier_t getContextItemStaticType()

Fetch the type of the context item.

getCopyNamespacesMode

const virtual void getCopyNamespacesMode(
    preserve_mode_t & aPreserve,
    inherit_mode_t & aInherit
)

Get the copy namespace mode.

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

Returns

aPreserve the preserve mode.

aInherit the inherit mode.

getDefaultCollation

const virtual String getDefaultCollation()

Get the URI of the default collation.

Returns

String the URI of the default collation.

getDefaultElementAndTypeNamespace

const virtual String getDefaultElementAndTypeNamespace()

Get the default element and type namespace URI.

Returns

String the URI for the default element and type namespace.

Parameters

if an error occured.

getDefaultFunctionNamespace

const virtual String getDefaultFunctionNamespace()

Get the default function namespace.

Returns

String the URI of the default function namespace. DiagnosticHandler has been registered.

Parameters

if an error occured.

getDefaultOrderForEmptySequences

const virtual order_empty_mode_t getDefaultOrderForEmptySequences()

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.

getDocumentType

const virtual TypeIdentifier_t getDocumentType(
    const String & aDocUri
)

Get the type of a statically known document.

getExternalVariables

const virtual void getExternalVariables(
    Iterator_t & aVarsIter
)

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

Parameters

aVarsIter

iterator to store the results.

Parameters

if an error occured.

getFullLibPath

const virtual void getFullLibPath(
    std::vector< String > & aLibPath
)

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

getFullModulePaths

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

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

DeprecatedUse StaticContext::getFullURIPath() and StaticContext::getFullLibPath().

getFullURIPath

const virtual void getFullURIPath(
    std::vector< String > & aURIPath
)

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

getFunctionAnnotations

const virtual void getFunctionAnnotations(
    const Item & aQName,
    int arity,
    std::vector< Annotation_t > & aAnnotations
)

getFunctions

const virtual void getFunctions(
    std::vector< Function_t > & aFunctions
)

Get all functions declared in the given static context.

Returns

aFunctions all of the said functions

getFunctions

const virtual void getFunctions(
    const String & aFnNameUri,
    uint32_t arity,
    std::vector< Function_t > & aFunctions
)

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

Parameters

aFnNameUri

the namespace for the functions to return

arity

the arity for the functions to return

aFunctions

all of the said functions

getLibPath

const virtual void getLibPath(
    std::vector< String > & aLibPath
)

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().

getModulePaths

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

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

DeprecatedUse 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.

getNamespaceBindings

const virtual void getNamespaceBindings(
    NsBindings & aBindings
)

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

Parameters

aBindings

the bindings are added to this list

getNamespaceURIByPrefix

const virtual String getNamespaceURIByPrefix(
    const String & aPrefix
)

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 DiagnosticHandler has been registered.

Parameters

if an error occured (e.g. no URI could be found for the given prefix).

DeprecatedThis function is deprecated. Use getNamespaceBindings instead.

getOption

const virtual bool getOption(
    const Item & aQName,
    String & aOptionValue
)

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

Parameters

aQName

The QName of the option to get.

aOptionValue

The value of the option if found.

Returns

true if the option was found, false otherwise.

getOrderingMode

const virtual ordering_mode_t getOrderingMode()

Get the ordering mode.

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

Returns

ordering_mode_t the ordering mode.

getRefCount

const inline long getRefCount()

getRevalidationMode

const virtual validation_mode_t getRevalidationMode()

Get the revalidation mode.

Returns

the revalidation mode.

getStaticCollectionManager

const virtual StaticCollectionManager * getStaticCollectionManager()

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.

getURIPath

const virtual void getURIPath(
    std::vector< String > & aURIPath
)

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().

getXPath1_0CompatibMode

const virtual xpath1_0compatib_mode_t getXPath1_0CompatibMode()

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.

getXQueryVersion

const virtual xquery_version_t getXQueryVersion()

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

Returns

xquery_version_t the XQuery version processing mode.

invoke

const virtual ItemSequence_t invoke(
    const Item & aQName,
    const std::vector< ItemSequence_t > & aArgs
)

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

aQName

the name of the function to be invoked

aArgs

a 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.

loadProlog

virtual void loadProlog(
    const String &  ,
    const Zorba_CompilerHints_t & hints
)

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).

registerModule

virtual bool registerModule(
    ExternalModule * aModule
)

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

aModule

the module object

Returns

true if the module has been set, false otherwise.

registerURIMapper

virtual void registerURIMapper(
    URIMapper * aMapper
)

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

QQQ doc

registerURLResolver

virtual void registerURLResolver(
    URLResolver * aResolver
)

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

QQQ doc

removeReference

inline void removeReference()

resetTraceStream

virtual void resetTraceStream()

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

resolve

const virtual String resolve(
    const String & aRelativeUri
)

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

Parameters

aRelativeUri

The relative URI to be resolved.

resolve

const virtual String resolve(
    const String & aRelativeUri,
    const String & aBaseUri
)

Resolves the given relative URI against the absolute base URI.

Parameters

aRelativeUri

The relative URI to be resolved.

aBaseUri

The absolute URI against which the resolving is performed.

setAuditEvent

virtual void setAuditEvent(
    audit::Event * anEvent
)

sets the audit event that will be populated during execution

Parameters

anEvent

the audit event

setBaseURI

virtual bool setBaseURI(
    const String & aBaseURI
)

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.

setBoundarySpacePolicy

virtual bool setBoundarySpacePolicy(
    boundary_space_mode_t aMode
)

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.

setCollectionType

virtual void setCollectionType(
    const String & aCollectionUri,
    TypeIdentifier_t type
)

Set the type of a statically known collection.

setConstructionMode

virtual bool setConstructionMode(
    construction_mode_t aMode
)

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.

setContextItemStaticType

virtual void setContextItemStaticType(
    TypeIdentifier_t type
)

Set the type of the context item.

setCopyNamespacesMode

virtual bool setCopyNamespacesMode(
    preserve_mode_t aPreserve,
    inherit_mode_t aInherit
)

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.

setDefaultCollation

virtual void setDefaultCollation(
    const String & aURI
)

Set the URI of the default collation.

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

Parameters

aURI

URI of the default collation.

Parameters

if an error occured (e.g., the URI does not identify a collation among the statically known collations.

setDefaultElementAndTypeNamespace

virtual bool setDefaultElementAndTypeNamespace(
    const String & aURI
)

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 DiagnosticHandler has been registered.

Parameters

if an error occured.

setDefaultFunctionNamespace

virtual bool setDefaultFunctionNamespace(
    const String & aURI
)

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 DiagnosticHandler has been registered.

Parameters

if an error occured.

setDefaultOrderForEmptySequences

virtual bool setDefaultOrderForEmptySequences(
    order_empty_mode_t aMode
)

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.

setDocumentType

virtual void setDocumentType(
    const String & aDocUri,
    TypeIdentifier_t type
)

Set the type of a statically known document.

setLibPath

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

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.

setModulePaths

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

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(). DeprecatedUse StaticContext::setURIPath() and StaticContext::setLibPath().

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

setOrderingMode

virtual bool setOrderingMode(
    ordering_mode_t aMode
)

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.

setRevalidationMode

virtual void setRevalidationMode(
    validation_mode_t aMode
)

Set the revalidation mode.

Parameters

aMode

the revalidation mode.

setTraceStream

virtual void setTraceStream(
    std::ostream & 
)

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.

setURIPath

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

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.

setXPath1_0CompatibMode

virtual bool setXPath1_0CompatibMode(
    xpath1_0compatib_mode_t aMode
)

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.

setXQueryVersion

virtual bool setXQueryVersion(
    xquery_version_t aMode
)

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

Parameters

aMode

the XQuery version.

Returns

true if the version was set, false otherwise.

validate

const virtual bool validate(
    const Item & rootElement,
    Item & validatedResult,
    validation_mode_t validationMode=validate_strict
)

Validates this Item.

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

Parameters

rootElement

the root of the tree beeing validated

validatedResult

the result of the validation

validationMode

Validation mode: default value is validate_strict

Returns

true if validation is correct, false if validation is disabled, throws errors if validation fails

Parameters

if any validation error occured

validate

const virtual bool validate(
    const Item & rootElement,
    Item & validatedResult,
    const String & targetNamespace,
    validation_mode_t validationMode=validate_strict
)

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

Parameters

rootElement

the root of the tree beeing validated

validatedResult

the result of the validation

targetNamespace

the expected namespace of root of the tree beeing validated ???

validationMode

Validation mode: default value is validate_strict

Returns

true if validation is correct, false if validation is disabled, throws errors if validation fails

Parameters

if any validation error occured

validateSimpleContent

const virtual bool validateSimpleContent(
    const String & stringValue,
    const Item & typeQName,
    std::vector< Item > & resultList
)

Validates stringValue as XML simple content, i.e.

the text value of attributes or text only element content.

Parameters

stringValue

the value to be validated

typeQName

resultList

the 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

Parameters

if any validation error occured

~StaticContext

inline virtual  ~StaticContext()

Destructor.

Protected Attibutes

theRefCount

unsigned int theRefCount
blog comments powered by Disqus