SourceForge.net Logo
StaticContext Class Referenceabstract

The parse time static context interface. More...

#include <StaticContext.hpp>

Inheritance diagram for StaticContext:

Public Types

enum  NodeSetOrdering { ORDERING_ORDERED , ORDERING_UNORDERED }
enum  ConstructionMode { CONSTRUCTION_MODE_PRESERVE , CONSTRUCTION_MODE_STRIP }
enum  FLWOROrderingMode { FLWOR_ORDER_EMPTY_GREATEST , FLWOR_ORDER_EMPTY_LEAST }
enum  FTCaseOption {
  NONE , CASE_INSENSITIVE , CASE_SENSITIVE , UPPERCASE ,
  LOWERCASE
}

Public Member Functions

virtual ~StaticContext ()
virtual DynamicContextcreateModuleContext (xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual DynamicContextcreateDynamicContext (xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual DynamicContextcreateDebugQueryContext (const Item::Ptr &contextItem, size_t contextPosition, size_t contextSize, const VariableStore *variables, const xercesc::DOMXPathNSResolver *nsResolver, const XMLCh *defaultElementNS, xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual XQillaConfigurationgetConfiguration () const =0
 Returns the configuration object for this context.
virtual XQilla::Language getLanguage () const =0
 Returns the lanuage that this context is for.
virtual ItemFactorygetItemFactory () const =0
 Returns the ItemFactory for this context, which is used to create XQilla items and other objects.
virtual void setItemFactory (ItemFactory *factory)=0
 Sets the ItemFactory for this context.
virtual const StaticTypegetContextItemType () const =0
 Get the static type of the context item.
virtual void setContextItemType (const StaticType &st)=0
 Set the static type of the context item.
virtual bool getXPath1CompatibilityMode () const =0
 Get the current XPath 1.0 compatibility mode.
virtual void setXPath1CompatibilityMode (bool newMode)=0
 Set the current XPath 1.0 compatibility mode.
virtual const xercesc::DOMXPathNSResolvergetNSResolver () const =0
 Get the NS resolver.
virtual const XMLCh * getUriBoundToPrefix (const XMLCh *prefix, const LocationInfo *location=0) const =0
 returns the URI that is bound in prefix in the current scope or zero length string otherwise
virtual const XMLCh * getPrefixBoundToUri (const XMLCh *uri) const =0
 returns the prefix that is bound in uri in the current scope or zero length string otherwise
virtual void setNSResolver (const xercesc::DOMXPathNSResolver *resolver)=0
 Set the NS resolver.
virtual void setNamespaceBinding (const XMLCh *prefix, const XMLCh *uri)=0
 Binds a prefix to a namespace URI.
virtual const XMLCh * getDefaultElementAndTypeNS () const =0
 get the value of the default namespace for elements and types
virtual void setDefaultElementAndTypeNS (const XMLCh *newNS)=0
 set the value of the default namespace for elements and types
virtual const XMLCh * getDefaultFuncNS () const =0
 Return the default namespace for functions.
virtual void setDefaultFuncNS (const XMLCh *newNS)=0
 Set the default namespace for functions.
virtual DocumentCachegetDocumentCache () const =0
 retrieve the repository for the grammars
virtual void setDocumentCache (DocumentCache *docCache)=0
 sets the repository for the grammars
virtual bool isTypeOrDerivedFromType (const XMLCh *const uri, const XMLCh *const typeName, const XMLCh *const uriToCheck, const XMLCh *const typeNameToCheck) const =0
 returns true if the type represented by uri:typename is an instance of uriToCheck:typeNameToCheck
virtual void setXMLEntityResolver (xercesc::XMLEntityResolver *const handler)=0
 Sets the XMLEntityResolver that is used by Xerces when it is used to parse documents.
virtual xercesc::XMLEntityResolvergetXMLEntityResolver () const =0
 Returns the entity resolver currently set.
virtual void setModuleResolver (ModuleResolver *resolver)=0
 Register a callback object for resolving module URIs.
virtual ModuleResolvergetModuleResolver () const =0
 Returns the module resolver currently set.
virtual VectorOfStringsresolveModuleURI (const XMLCh *uri) const =0
virtual void addSchemaLocation (const XMLCh *uri, VectorOfStrings *locations, const LocationInfo *location=0)=0
 add the location for the grammar of a specific namespace
virtual VariableTypeStoregetVariableTypeStore ()=0
 get the variable type store
virtual void addTemplate (XQUserFunction *tp)=0
 adds a template definition to the template tables
virtual const XQUserFunction * lookUpNamedTemplate (const XMLCh *uri, const XMLCh *name) const =0
 look up a template definition by name
virtual const UserFunctionsgetTemplateRules () const =0
 Return a vector of all the templates with patterns.
virtual void addCustomFunction (FuncFactory *func)=0
 adds a custom function to the function table
virtual void removeCustomFunction (FuncFactory *func)=0
 removes a custom function to the function table
virtual ASTNode * lookUpFunction (const XMLCh *uri, const XMLCh *name, const VectorOfASTNodes &v, const LocationInfo *location=0) const =0
 returns a function object with the given uri, localname and number of arguments triple
virtual void setExternalFunctionResolver (ExternalFunctionResolver *resolver)=0
 Register a callback object for resolving external function implementations.
virtual ExternalFunctionResolvergetExternalFunctionResolver () const =0
 Returns the external function resolver currently set.
virtual void addExternalFunction (const ExternalFunction *func)=0
 adds an external function implementation to the function table
virtual const ExternalFunctionlookUpExternalFunction (const XMLCh *uri, const XMLCh *name, size_t numArgs) const =0
 returns an external function implementation for the given uri and localname
virtual CollationgetCollation (const XMLCh *const URI, const LocationInfo *location=0) const =0
 Get the implementation for the specified collation.
virtual void addCollation (Collation *collation)=0
 Add a collation.
virtual CollationgetDefaultCollation (const LocationInfo *location=0) const =0
 Get the default collation.
virtual void setDefaultCollation (const XMLCh *const URI)=0
 Specify which collation is the default one.
virtual const XMLCh * getBaseURI () const =0
 Return the base URI.
virtual void setBaseURI (const XMLCh *newURI)=0
 Set the base URI.
virtual NodeSetOrdering getNodeSetOrdering () const =0
 Return the ordering method for node sets.
virtual void setNodeSetOrdering (NodeSetOrdering newOrder)=0
 Set the ordering method for node sets.
virtual ConstructionMode getConstructionMode () const =0
 Return the construction mode.
virtual void setConstructionMode (ConstructionMode newMode)=0
 Set the construction mode.
virtual void setPreserveBoundarySpace (bool value)=0
 Set the policy for boundary space.
virtual bool getPreserveBoundarySpace () const =0
 Get the policy for boundary space.
virtual FLWOROrderingMode getDefaultFLWOROrderingMode () const =0
 Return the default ordering mode for FLWOR blocks.
virtual void setDefaultFLWOROrderingMode (FLWOROrderingMode newMode)=0
 Set the default ordering mode for FLWOR blocks.
virtual void setInheritNamespaces (bool value)=0
 Set the policy for namespace inheritance.
virtual bool getInheritNamespaces () const =0
 Get the policy for namespace inheritance.
virtual void setPreserveNamespaces (bool value)=0
 Set the policy for namespace copy.
virtual bool getPreserveNamespaces () const =0
 Get the policy for namespace copy.
virtual void setRevalidationMode (DocumentCache::ValidationMode mode)=0
 Set the revalidation mode.
virtual DocumentCache::ValidationMode getRevalidationMode () const =0
 Get the revalidation mode.
virtual void setMessageListener (MessageListener *listener)=0
 Set the listener for warning and trace messages.
virtual MessageListenergetMessageListener () const =0
 Gets the listener for warning and trace messages.
virtual void setModule (XQQuery *module)=0
 Set the module.
virtual XQQuerygetModule () const =0
 Get the module.
virtual bool getProjection () const =0
 Gets whether document projection is enabled.
virtual void setProjection (bool enabled)=0
 Sets whether document projection is enabled.
virtual bool getDoLintWarnings () const =0
virtual void setDoLintWarnings (bool enabled)=0
virtual const XMLCh * allocateTempVarName (const XMLCh *prefix=0)=0
 Return a unique name that can be used for a temporary variable.
virtual XPath2MemoryManagergetMemoryManager () const =0
 Get the memory manager.
virtual void setMemoryManager (XPath2MemoryManager *memMgr)=0
 Set the memory manager to the one given.
virtual void setFTCase (FTCaseOption option)=0
 Set default full text query case option.
virtual FTCaseOption getFTCase ()=0

Detailed Description

The parse time static context interface.

Member Enumeration Documentation

◆ ConstructionMode

Enumerator
CONSTRUCTION_MODE_PRESERVE 
CONSTRUCTION_MODE_STRIP 

◆ FLWOROrderingMode

Enumerator
FLWOR_ORDER_EMPTY_GREATEST 
FLWOR_ORDER_EMPTY_LEAST 

◆ FTCaseOption

Enumerator
NONE 
CASE_INSENSITIVE 
CASE_SENSITIVE 
UPPERCASE 
LOWERCASE 

◆ NodeSetOrdering

Enumerator
ORDERING_ORDERED 
ORDERING_UNORDERED 

Constructor & Destructor Documentation

◆ ~StaticContext()

virtual StaticContext::~StaticContext ( )
inlinevirtual

Member Function Documentation

◆ addCollation()

virtual void StaticContext::addCollation ( Collation * collation)
pure virtual

Add a collation.

◆ addCustomFunction()

virtual void StaticContext::addCustomFunction ( FuncFactory * func)
pure virtual

adds a custom function to the function table

◆ addExternalFunction()

virtual void StaticContext::addExternalFunction ( const ExternalFunction * func)
pure virtual

adds an external function implementation to the function table

◆ addSchemaLocation()

virtual void StaticContext::addSchemaLocation ( const XMLCh * uri,
VectorOfStrings * locations,
const LocationInfo * location = 0 )
pure virtual

add the location for the grammar of a specific namespace

◆ addTemplate()

virtual void StaticContext::addTemplate ( XQUserFunction * tp)
pure virtual

adds a template definition to the template tables

◆ allocateTempVarName()

virtual const XMLCh * StaticContext::allocateTempVarName ( const XMLCh * prefix = 0)
pure virtual

Return a unique name that can be used for a temporary variable.

◆ createDebugQueryContext()

virtual DynamicContext * StaticContext::createDebugQueryContext ( const Item::Ptr & contextItem,
size_t contextPosition,
size_t contextSize,
const VariableStore * variables,
const xercesc::DOMXPathNSResolver * nsResolver,
const XMLCh * defaultElementNS,
xercesc::MemoryManager * memMgr = xercesc::XMLPlatformUtils::fgMemoryManager ) const
pure virtual

◆ createDynamicContext()

virtual DynamicContext * StaticContext::createDynamicContext ( xercesc::MemoryManager * memMgr = xercesc::XMLPlatformUtils::fgMemoryManager) const
pure virtual

◆ createModuleContext()

virtual DynamicContext * StaticContext::createModuleContext ( xercesc::MemoryManager * memMgr = xercesc::XMLPlatformUtils::fgMemoryManager) const
pure virtual

◆ getBaseURI()

virtual const XMLCh * StaticContext::getBaseURI ( ) const
pure virtual

Return the base URI.

◆ getCollation()

virtual Collation * StaticContext::getCollation ( const XMLCh *const URI,
const LocationInfo * location = 0 ) const
pure virtual

Get the implementation for the specified collation.

◆ getConfiguration()

virtual XQillaConfiguration * StaticContext::getConfiguration ( ) const
pure virtual

Returns the configuration object for this context.

◆ getConstructionMode()

virtual ConstructionMode StaticContext::getConstructionMode ( ) const
pure virtual

Return the construction mode.

◆ getContextItemType()

virtual const StaticType & StaticContext::getContextItemType ( ) const
pure virtual

◆ getDefaultCollation()

virtual Collation * StaticContext::getDefaultCollation ( const LocationInfo * location = 0) const
pure virtual

Get the default collation.

◆ getDefaultElementAndTypeNS()

virtual const XMLCh * StaticContext::getDefaultElementAndTypeNS ( ) const
pure virtual

get the value of the default namespace for elements and types

Referenced by AutoNsScopeReset::AutoNsScopeReset().

◆ getDefaultFLWOROrderingMode()

virtual FLWOROrderingMode StaticContext::getDefaultFLWOROrderingMode ( ) const
pure virtual

Return the default ordering mode for FLWOR blocks.

◆ getDefaultFuncNS()

virtual const XMLCh * StaticContext::getDefaultFuncNS ( ) const
pure virtual

Return the default namespace for functions.

◆ getDocumentCache()

virtual DocumentCache * StaticContext::getDocumentCache ( ) const
pure virtual

retrieve the repository for the grammars

◆ getDoLintWarnings()

virtual bool StaticContext::getDoLintWarnings ( ) const
pure virtual

◆ getExternalFunctionResolver()

virtual ExternalFunctionResolver * StaticContext::getExternalFunctionResolver ( ) const
pure virtual

Returns the external function resolver currently set.

◆ getFTCase()

virtual FTCaseOption StaticContext::getFTCase ( )
pure virtual

◆ getInheritNamespaces()

virtual bool StaticContext::getInheritNamespaces ( ) const
pure virtual

Get the policy for namespace inheritance.

◆ getItemFactory()

virtual ItemFactory * StaticContext::getItemFactory ( ) const
pure virtual

Returns the ItemFactory for this context, which is used to create XQilla items and other objects.

◆ getLanguage()

virtual XQilla::Language StaticContext::getLanguage ( ) const
pure virtual

Returns the lanuage that this context is for.

This value cannot be set, since it is used to correctly construct the StaticContext

◆ getMemoryManager()

virtual XPath2MemoryManager * StaticContext::getMemoryManager ( ) const
pure virtual

Get the memory manager.

◆ getMessageListener()

virtual MessageListener * StaticContext::getMessageListener ( ) const
pure virtual

Gets the listener for warning and trace messages.

Referenced by AutoMessageListenerReset::AutoMessageListenerReset().

◆ getModule()

virtual XQQuery * StaticContext::getModule ( ) const
pure virtual

Get the module.

◆ getModuleResolver()

virtual ModuleResolver * StaticContext::getModuleResolver ( ) const
pure virtual

Returns the module resolver currently set.

◆ getNodeSetOrdering()

virtual NodeSetOrdering StaticContext::getNodeSetOrdering ( ) const
pure virtual

Return the ordering method for node sets.

Referenced by AutoNodeSetOrderingReset::AutoNodeSetOrderingReset().

◆ getNSResolver()

virtual const xercesc::DOMXPathNSResolver * StaticContext::getNSResolver ( ) const
pure virtual

Get the NS resolver.

◆ getPrefixBoundToUri()

virtual const XMLCh * StaticContext::getPrefixBoundToUri ( const XMLCh * uri) const
pure virtual

returns the prefix that is bound in uri in the current scope or zero length string otherwise

◆ getPreserveBoundarySpace()

virtual bool StaticContext::getPreserveBoundarySpace ( ) const
pure virtual

Get the policy for boundary space.

◆ getPreserveNamespaces()

virtual bool StaticContext::getPreserveNamespaces ( ) const
pure virtual

Get the policy for namespace copy.

◆ getProjection()

virtual bool StaticContext::getProjection ( ) const
pure virtual

Gets whether document projection is enabled.

Document projection is an optimisation that uses query analysis to remove sub-trees from documents that aren't needed by the query. This results in substantially smaller memory usage and faster query times, but means that any subsequent querying on the results of an initial query can be wrong.

If you are hoping to perform further queries on the results of a query, you should turn document projection off to avoid incorrect results.

◆ getRevalidationMode()

virtual DocumentCache::ValidationMode StaticContext::getRevalidationMode ( ) const
pure virtual

Get the revalidation mode.

◆ getTemplateRules()

virtual const UserFunctions & StaticContext::getTemplateRules ( ) const
pure virtual

Return a vector of all the templates with patterns.

◆ getUriBoundToPrefix()

virtual const XMLCh * StaticContext::getUriBoundToPrefix ( const XMLCh * prefix,
const LocationInfo * location = 0 ) const
pure virtual

returns the URI that is bound in prefix in the current scope or zero length string otherwise

◆ getVariableTypeStore()

virtual VariableTypeStore * StaticContext::getVariableTypeStore ( )
pure virtual

get the variable type store

◆ getXMLEntityResolver()

virtual xercesc::XMLEntityResolver * StaticContext::getXMLEntityResolver ( ) const
pure virtual

Returns the entity resolver currently set.

◆ getXPath1CompatibilityMode()

virtual bool StaticContext::getXPath1CompatibilityMode ( ) const
pure virtual

Get the current XPath 1.0 compatibility mode.

◆ isTypeOrDerivedFromType()

virtual bool StaticContext::isTypeOrDerivedFromType ( const XMLCh *const uri,
const XMLCh *const typeName,
const XMLCh *const uriToCheck,
const XMLCh *const typeNameToCheck ) const
pure virtual

returns true if the type represented by uri:typename is an instance of uriToCheck:typeNameToCheck

ie: to check xs:integer instance of xs:decimal, call isTypeOrDerivedFromType("xs", "integer", "xs", "decimal") (except of course, call with URIs, not prefixes!)

◆ lookUpExternalFunction()

virtual const ExternalFunction * StaticContext::lookUpExternalFunction ( const XMLCh * uri,
const XMLCh * name,
size_t numArgs ) const
pure virtual

returns an external function implementation for the given uri and localname

◆ lookUpFunction()

virtual ASTNode * StaticContext::lookUpFunction ( const XMLCh * uri,
const XMLCh * name,
const VectorOfASTNodes & v,
const LocationInfo * location = 0 ) const
pure virtual

returns a function object with the given uri, localname and number of arguments triple

◆ lookUpNamedTemplate()

virtual const XQUserFunction * StaticContext::lookUpNamedTemplate ( const XMLCh * uri,
const XMLCh * name ) const
pure virtual

look up a template definition by name

◆ removeCustomFunction()

virtual void StaticContext::removeCustomFunction ( FuncFactory * func)
pure virtual

removes a custom function to the function table

◆ resolveModuleURI()

virtual VectorOfStrings * StaticContext::resolveModuleURI ( const XMLCh * uri) const
pure virtual

◆ setBaseURI()

virtual void StaticContext::setBaseURI ( const XMLCh * newURI)
pure virtual

Set the base URI.

◆ setConstructionMode()

virtual void StaticContext::setConstructionMode ( ConstructionMode newMode)
pure virtual

Set the construction mode.

◆ setContextItemType()

virtual void StaticContext::setContextItemType ( const StaticType & st)
pure virtual

Set the static type of the context item.

Referenced by AutoContextItemTypeReset::AutoContextItemTypeReset().

◆ setDefaultCollation()

virtual void StaticContext::setDefaultCollation ( const XMLCh *const URI)
pure virtual

Specify which collation is the default one.

◆ setDefaultElementAndTypeNS()

virtual void StaticContext::setDefaultElementAndTypeNS ( const XMLCh * newNS)
pure virtual

set the value of the default namespace for elements and types

◆ setDefaultFLWOROrderingMode()

virtual void StaticContext::setDefaultFLWOROrderingMode ( FLWOROrderingMode newMode)
pure virtual

Set the default ordering mode for FLWOR blocks.

◆ setDefaultFuncNS()

virtual void StaticContext::setDefaultFuncNS ( const XMLCh * newNS)
pure virtual

Set the default namespace for functions.

◆ setDocumentCache()

virtual void StaticContext::setDocumentCache ( DocumentCache * docCache)
pure virtual

sets the repository for the grammars

◆ setDoLintWarnings()

virtual void StaticContext::setDoLintWarnings ( bool enabled)
pure virtual

◆ setExternalFunctionResolver()

virtual void StaticContext::setExternalFunctionResolver ( ExternalFunctionResolver * resolver)
pure virtual

Register a callback object for resolving external function implementations.

◆ setFTCase()

virtual void StaticContext::setFTCase ( FTCaseOption option)
pure virtual

Set default full text query case option.

◆ setInheritNamespaces()

virtual void StaticContext::setInheritNamespaces ( bool value)
pure virtual

Set the policy for namespace inheritance.

◆ setItemFactory()

virtual void StaticContext::setItemFactory ( ItemFactory * factory)
pure virtual

Sets the ItemFactory for this context.

◆ setMemoryManager()

virtual void StaticContext::setMemoryManager ( XPath2MemoryManager * memMgr)
pure virtual

Set the memory manager to the one given.

◆ setMessageListener()

virtual void StaticContext::setMessageListener ( MessageListener * listener)
pure virtual

Set the listener for warning and trace messages.

Referenced by AutoMessageListenerReset::AutoMessageListenerReset().

◆ setModule()

virtual void StaticContext::setModule ( XQQuery * module)
pure virtual

Set the module.

◆ setModuleResolver()

virtual void StaticContext::setModuleResolver ( ModuleResolver * resolver)
pure virtual

Register a callback object for resolving module URIs.

◆ setNamespaceBinding()

virtual void StaticContext::setNamespaceBinding ( const XMLCh * prefix,
const XMLCh * uri )
pure virtual

Binds a prefix to a namespace URI.

◆ setNodeSetOrdering()

virtual void StaticContext::setNodeSetOrdering ( NodeSetOrdering newOrder)
pure virtual

Set the ordering method for node sets.

Referenced by AutoNodeSetOrderingReset::AutoNodeSetOrderingReset().

◆ setNSResolver()

virtual void StaticContext::setNSResolver ( const xercesc::DOMXPathNSResolver * resolver)
pure virtual

Set the NS resolver.

◆ setPreserveBoundarySpace()

virtual void StaticContext::setPreserveBoundarySpace ( bool value)
pure virtual

Set the policy for boundary space.

◆ setPreserveNamespaces()

virtual void StaticContext::setPreserveNamespaces ( bool value)
pure virtual

Set the policy for namespace copy.

◆ setProjection()

virtual void StaticContext::setProjection ( bool enabled)
pure virtual

Sets whether document projection is enabled.

Document projection can be enabled or disabled at compile time, as well as overridden at runtime. By default document projection is enabled unless query complilation is unable to guarentee its correctness.

Document projection is an optimisation that uses query analysis to remove sub-trees from documents that aren't needed by the query. This results in substantially smaller memory usage and faster query times, but means that any subsequent querying on the results of an initial query can be wrong.

If you are hoping to perform further queries on the results of a query, you should turn document projection off to avoid incorrect results.

◆ setRevalidationMode()

virtual void StaticContext::setRevalidationMode ( DocumentCache::ValidationMode mode)
pure virtual

Set the revalidation mode.

◆ setXMLEntityResolver()

virtual void StaticContext::setXMLEntityResolver ( xercesc::XMLEntityResolver *const handler)
pure virtual

Sets the XMLEntityResolver that is used by Xerces when it is used to parse documents.

This affects the behaviour of XQilla whenever it retrieves a DTD or XML Schema grammar.

◆ setXPath1CompatibilityMode()

virtual void StaticContext::setXPath1CompatibilityMode ( bool newMode)
pure virtual

Set the current XPath 1.0 compatibility mode.


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