StaticContext#include </home/jenkins/.jenkins/ubuntu-remote-queue/jenkins-BuildZorbaUbuntu-462/source/zorba/swig/StaticContext.h> 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.Friend Classes
Private Attributes
Public Functions
Friend ClassesSequenceTypefriend class SequenceType
XQueryfriend class XQuery
Zorbafriend class Zorba
Private AttributestheStaticContextzorba::StaticContext_t theStaticContext
Public FunctionsaddColationvoid addColation(const std::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://zorba.io/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://zorba.io/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
Parameters
addNamespacebool addNamespace(const std::string &aPrefix, const std::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
Returnstrue if the pair was added to the set of statically known namespaces, false otherwise.Parameters
containsFunctionbool containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const Check if a function with the given name and arity are registered in the context.
createChildContextStaticContext createChildContext() const 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. declareOptionvoid declareOption(const Item &aQName, const std::string &aOptionVal) Declare an option (same as using declare option in XQuery)
Parameters
destroyvoid destroy() Destroy this object from memory.
disableFunctionvoid disableFunction(const Item &aQName, int arity)
getBaseURIstd::string getBaseURI() const Get the base URI.
ReturnsString the base URI.getBoundarySpacePolicyZorbaConstants::BoundarySpaceMode getBoundarySpacePolicy() Get the boundary space policy. (see http://www.w3.org/TR/xquery/#static_context) Returnsboundary_space_mode_t the boundary space policy.getCollectionTypeSequenceType getCollectionType(const std::string &aCollectionUri) Get the type of a statically known collection.
getConstructionModeZorbaConstants::ConstructionMode getConstructionMode() Get the construction mode. (see http://www.w3.org/TR/xquery/#static_context) Returnsconstruction_mode_t the construction mode.getCopyNamespacesModeInheritZorbaConstants::InheritMode getCopyNamespacesModeInherit() Get the copy namespace mode for Preserve. (see http://www.w3.org/TR/xquery/#static_context) ReturnsaInherit the inherit mode.getCopyNamespacesModePreserveZorbaConstants::PreserveMode getCopyNamespacesModePreserve() Get the copy namespace mode for Preserve. (see http://www.w3.org/TR/xquery/#static_context) ReturnsaPreserve the preserve mode.getDefaultCollationstd::string getDefaultCollation() const Get the URI of the default collation.
ReturnsString the URI of the default collation.getDefaultElementAndTypeNamespacestd::string getDefaultElementAndTypeNamespace() const Get the default element and type namespace URI.
ReturnsString the URI for the default element and type namespace.Parameters
getDefaultFunctionNamespacestd::string getDefaultFunctionNamespace() const Get the default function namespace.
ReturnsString the URI of the default function namespace. DiagnosticHandler has been registered.Parameters
getDefaultOrderForEmptySequencesZorbaConstants::OrderEmptyMode getDefaultOrderForEmptySequences() Get the default order for the empty sequence. (see http://www.w3.org/TR/xquery/#static_context) Returnsorder_empty_mode_t the ordering mode.getDocumentTypeSequenceType getDocumentType(const std::string &aDocUri) Get the type of a statically known document.
getExternalVariablesvoid getExternalVariables(Iterator &vars) const Returns the QName of all external variables within the static context.
Parameters
Parameters
getNamespaceBindingsstd::vector< std::pair< std::string, std::string > > getNamespaceBindings() Get the list of all namespace bindings (prefix, uri) declared in this and its parent static contexts.
getNamespaceURIByPrefixstd::string getNamespaceURIByPrefix(const std::string &aPrefix) const Get the namespace URI for a given prefix.
Parameters
ReturnsString 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
getOptionbool getOption(const Item &aQName, std::string &aOptionValue) const Get an option that was declared using the declare option syntax.
Parameters
Returnstrue if the option was found, false otherwise.getOrderingModeZorbaConstants::OrderingMode getOrderingMode() Get the ordering mode. (see http://www.w3.org/TR/xquery/#static_context) Returnsordering_mode_t the ordering mode.getRevalidationModeZorbaConstants::RevalidationMode getRevalidationMode() Get the revalidation mode.
Returnsthe revalidation mode.getStaticCollectionManagerStaticCollectionManager 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. ReturnsThe collection manager responsible for managing collections of this context.getXPath1_0CompatibModeZorbaConstants::XPath1_0CompatibleMode getXPath1_0CompatibMode() Get the XPath 1.0 compatibility mode. (see http://www.w3.org/TR/xquery/#static_context) Returnsxpath1_0compatib_mode_t the XPath 1.0 compatibility mode.loadPrologvoid loadProlog(const std::string &aProlog, const CompilerHints &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). resetTraceStreamvoid resetTraceStream() Resets the output stream that is used by the fn:trace function to std::cerr.
setBaseURIbool setBaseURI(const std::string &aBaseURI) Set the base URI. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the base URI has been set, false otherwise.setBoundarySpacePolicybool setBoundarySpacePolicy(ZorbaConstants::BoundarySpaceMode aMode) Set the boundary space policy. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.setConstructionModebool setConstructionMode(ZorbaConstants::ConstructionMode aMode) Set the construction mode. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.setContextItemStaticTypevoid setContextItemStaticType(const SequenceType &aType) Set the type of the context item.
setCopyNamespacesModebool setCopyNamespacesMode(ZorbaConstants::PreserveMode aPreserve, ZorbaConstants::InheritMode aInherit) Set the copy namespace mode. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.setDefaultCollationvoid setDefaultCollation(const std::string &aURI) Set the URI of the default collation. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Parameters
setDefaultElementAndTypeNamespacebool setDefaultElementAndTypeNamespace(const std::string &aURI) Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context)
Parameters
Returnstrue if the default element and type namespace URI has been set, false otherwise if an DiagnosticHandler has been registered.Parameters
setDefaultFunctionNamespacebool setDefaultFunctionNamespace(const std::string &aURI) Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context)
Parameters
Returnstrue if the default function namespace URI has been set, false otherwise if an DiagnosticHandler has been registered.Parameters
setDefaultOrderForEmptySequencesbool setDefaultOrderForEmptySequences(ZorbaConstants::OrderEmptyMode aMode) Set the default order for the empty sequence. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.setLIBPathvoid setLIBPath(std::vector< std::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. setModulePathvoid setModulePath(std::vector< std::string > &aModulePath) 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(). setOrderingModebool setOrderingMode(ZorbaConstants::OrderingMode aMode) Set the ordering mode. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.setRevalidationModevoid setRevalidationMode(ZorbaConstants::RevalidationMode aMode) Set the revalidation mode.
Parameters
setURIPathvoid setURIPath(std::vector< std::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_0CompatibModebool setXPath1_0CompatibMode(ZorbaConstants::XPath1_0CompatibleMode aMode) Set the XPath 1.0 compatibility mode. (see http://www.w3.org/TR/xquery/#static_context) Parameters
Returnstrue if the mode was set, false otherwise.StaticContext StaticContext(const StaticContext &aStaticContext)
StaticContext StaticContext(zorba::StaticContext_t aStaticContext)
|