16 #ifndef API_STATIC_CONTEXT_H
17 #define API_STATIC_CONTEXT_H
19 #include <zorba/static_context_consts.h>
85 zorba::StaticContext_t theStaticContext;
124 const std::string& aURI);
129 const std::string &aFnNameLocal,
146 const std::string &aOptionVal);
256 bool getOption(
const Item &aQName, std::string &aOptionValue)
const;
270 void loadProlog (
const std::string & aProlog,
const CompilerHints &hints);
318 bool setBaseURI (
const std::string &aBaseURI);
374 void setURIPath(std::vector< std::string > &aURIPath );
384 void setLIBPath(std::vector< std::string > &aLIBPath );
396 void setModulePath(std::vector< std::string > &aModulePath );
void setContextItemStaticType(const TypeIdentifier &aType)
Set the type of the context item.
ZorbaConstants::ConstructionMode getConstructionMode()
Get the construction mode.
void destroy()
Destroy this object from memory.
void setURIPath(std::vector< std::string > &aURIPath)
Set the URI lookup path (list of filesystem directories) for this static context. ...
bool getOption(const Item &aQName, std::string &aOptionValue) const
Get an option that was declared using the declare option syntax.
ZorbaConstants::BoundarySpaceMode getBoundarySpacePolicy()
Get the boundary space policy.
bool setCopyNamespacesMode(ZorbaConstants::PreserveMode aPreserve, ZorbaConstants::InheritMode aInherit)
Set the copy namespace mode.
bool setBaseURI(const std::string &aBaseURI)
Set the base URI.
StaticContext(const StaticContext &aStaticContext)
std::string getNamespaceURIByPrefix(const std::string &aPrefix) const
Get the namespace URI for a given prefix.
Using the StaticCollectionManager one can retrieve information about statically declared collections ...
The Zorba class is the single point of access to the Zorba engine.
This class is the representation of an XQuery in the Zorba engine.
ZorbaConstants::OrderingMode getOrderingMode()
Get the ordering mode.
Instances of the class StaticContext contain the information that is available at the time the query ...
bool setBoundarySpacePolicy(ZorbaConstants::BoundarySpaceMode aMode)
Set the boundary space policy.
bool setConstructionMode(ZorbaConstants::ConstructionMode aMode)
Set the construction mode.
bool 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.
void setDefaultCollation(const std::string &aURI)
Set the URI of the default collation.
bool setOrderingMode(ZorbaConstants::OrderingMode aMode)
Set the ordering mode.
void addColation(const std::string &aURI)
Adds a collation URI.
ZorbaConstants::OrderEmptyMode getDefaultOrderForEmptySequences()
Get the default order for the empty sequence.
ZorbaConstants::RevalidationMode getRevalidationMode()
Get the revalidation mode.
bool setDefaultFunctionNamespace(const std::string &aURI)
Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context) ...
void declareOption(const Item &aQName, const std::string &aOptionVal)
Declare an option (same as using declare option in XQuery)
void resetTraceStream()
Resets the output stream that is used by the fn:trace function to std::cerr.
The Zorba Item interface.
void setRevalidationMode(ZorbaConstants::RevalidationMode aMode)
Set the revalidation mode.
void loadProlog(const std::string &aProlog, const CompilerHints &hints)
Loads the declarations and definitions of a given XQuery prolog into this static context.
ZorbaConstants::XPath1_0CompatibleMode getXPath1_0CompatibMode()
Get the XPath 1.0 compatibility mode.
std::string getDefaultCollation() const
Get the URI of the default collation.
std::string getDefaultFunctionNamespace() const
Get the default function namespace.
bool addNamespace(const std::string &aPrefix, const std::string &aURI)
Add a pair (prefix, URI) to the statically known namespaces that are available during query compilati...
std::string getDefaultElementAndTypeNamespace() const
Get the default element and type namespace URI.
TypeIdentifier getDocumentType(const std::string &aDocUri)
Get the type of a statically known document.
StaticContext createChildContext() const
Create a child static context, i.e.
Interface for an Iterator over an instance of the XML Data Model (i.e., a sequence of items)...
std::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...
bool setDefaultElementAndTypeNamespace(const std::string &aURI)
Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context) ...
void setModulePath(std::vector< std::string > &aModulePath)
Set the URI and library lookup paths (lists of filesystem directories) for this static context...
void disableFunction(const Item &aQName, int arity)
std::string getBaseURI() const
Get the base URI.
ZorbaConstants::PreserveMode getCopyNamespacesModePreserve()
Get the copy namespace mode for Preserve.
bool setXPath1_0CompatibMode(ZorbaConstants::XPath1_0CompatibleMode aMode)
Set the XPath 1.0 compatibility mode.
ZorbaConstants::InheritMode getCopyNamespacesModeInherit()
Get the copy namespace mode for Preserve.
TypeIdentifier getContextItemStaticType()
Fetch the type of the context item.
void getExternalVariables(Iterator &vars) const
Returns the QName of all external variables within the static context.
TypeIdentifier getCollectionType(const std::string &aCollectionUri)
Get the type of a statically known collection.
void setLIBPath(std::vector< std::string > &aLIBPath)
Set the library lookup path (list of filesystem directories) for this static context.
bool setDefaultOrderForEmptySequences(ZorbaConstants::OrderEmptyMode aMode)
Set the default order for the empty sequence.
StaticCollectionManager getStaticCollectionManager()
Returns a CollectionManager responsible for all collections which are statically declared in this sta...