00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _STATICCONTEXT_HPP
00023 #define _STATICCONTEXT_HPP
00024
00025 #include <xqilla/framework/XQillaExport.hpp>
00026 #include <xqilla/simple-api/XQilla.hpp>
00027 #include <time.h>
00028 #include <xqilla/schema/DocumentCache.hpp>
00029 #include <xercesc/util/PlatformUtils.hpp>
00030 #include <xercesc/util/XMemory.hpp>
00031
00032
00033 typedef std::vector<ASTNode*,XQillaAllocator<ASTNode*> > VectorOfASTNodes;
00034
00035 class DynamicContext;
00036 class XPath2MemoryManager;
00037 class FuncFactory;
00038 class DatatypeFactory;
00039 class Collation;
00040 class VariableTypeStore;
00041 class ItemFactory;
00042 class StaticType;
00043 class ModuleResolver;
00044 class MessageListener;
00045 class ExternalFunction;
00046 class XQillaConfiguration;
00047
00048 XERCES_CPP_NAMESPACE_BEGIN
00049 class DOMDocument;
00050 class DOMXPathNSResolver;
00051 class XMLEntityResolver;
00052 XERCES_CPP_NAMESPACE_END
00053
00055 class XQILLA_API StaticContext : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
00056 {
00057 public:
00058 typedef enum {
00059 ORDERING_ORDERED,
00060 ORDERING_UNORDERED
00061 } NodeSetOrdering;
00062
00063 typedef enum {
00064 CONSTRUCTION_MODE_PRESERVE,
00065 CONSTRUCTION_MODE_STRIP
00066 } ConstructionMode;
00067
00068 typedef enum {
00069 FLWOR_ORDER_EMPTY_GREATEST,
00070 FLWOR_ORDER_EMPTY_LEAST
00071 } FLWOROrderingMode;
00072
00073 virtual ~StaticContext() {};
00074
00075 virtual DynamicContext *createModuleContext(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00076 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager) const = 0;
00077 virtual DynamicContext *createDynamicContext(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00078 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager) const = 0;
00079
00081 virtual XQillaConfiguration *getConfiguration() const = 0;
00082
00085 virtual XQilla::Language getLanguage() const = 0;
00086
00088 virtual ItemFactory *getItemFactory() const = 0;
00090 virtual void setItemFactory(ItemFactory *factory) = 0;
00091
00093 virtual const StaticType &getContextItemType() const = 0;
00095 virtual void setContextItemType(const StaticType &st) = 0;
00096
00098 virtual bool getXPath1CompatibilityMode() const = 0;
00100 virtual void setXPath1CompatibilityMode(bool newMode) = 0;
00101
00103 virtual const XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* getNSResolver() const = 0;
00106 virtual const XMLCh* getUriBoundToPrefix(const XMLCh* prefix, const LocationInfo *location = 0) const = 0;
00109 virtual const XMLCh* getPrefixBoundToUri(const XMLCh* uri) const = 0;
00111 virtual void setNSResolver(const XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* resolver) = 0;
00113 virtual void setNamespaceBinding(const XMLCh* prefix, const XMLCh* uri) = 0;
00114
00116 virtual const XMLCh* getDefaultElementAndTypeNS() const = 0;
00118 virtual void setDefaultElementAndTypeNS(const XMLCh* newNS) = 0;
00119
00121 virtual const XMLCh* getDefaultFuncNS() const = 0;
00123 virtual void setDefaultFuncNS(const XMLCh* newNS) = 0;
00124
00126 virtual const DocumentCache* getDocumentCache() const = 0;
00128 virtual void setDocumentCache(DocumentCache* docCache) = 0;
00129
00138 virtual bool isTypeOrDerivedFromType(const XMLCh* const uri, const XMLCh* const typeName, const XMLCh* const uriToCheck, const XMLCh* const typeNameToCheck) const = 0;
00144 virtual void setXMLEntityResolver(XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* const handler) = 0;
00146 virtual XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* getXMLEntityResolver() const = 0;
00147
00149 virtual void setModuleResolver(ModuleResolver *resolver) = 0;
00151 virtual ModuleResolver *getModuleResolver() const = 0;
00152
00153 virtual VectorOfStrings* resolveModuleURI(const XMLCh* uri) const = 0;
00154
00156 virtual void addSchemaLocation(const XMLCh* uri, VectorOfStrings* locations, const LocationInfo *location = 0) = 0;
00157
00159 virtual VariableTypeStore* getVariableTypeStore() = 0;
00160
00162 virtual void addCustomFunction(FuncFactory *func) = 0;
00164 virtual ASTNode *lookUpFunction(const XMLCh *uri, const XMLCh* name, const VectorOfASTNodes &v) const = 0;
00165
00167 virtual void addExternalFunction(const ExternalFunction *func) = 0;
00169 virtual const ExternalFunction *lookUpExternalFunction(const XMLCh *uri, const XMLCh *name, size_t numArgs) const = 0;
00170
00172 virtual Collation* getCollation(const XMLCh* const URI, const LocationInfo *location = 0) const = 0;
00174 virtual void addCollation(Collation* collation) = 0;
00175
00177 virtual Collation* getDefaultCollation(const LocationInfo *location = 0) const = 0;
00179 virtual void setDefaultCollation(const XMLCh* const URI) = 0;
00180
00182 virtual const XMLCh* getBaseURI() const = 0;
00184 virtual void setBaseURI(const XMLCh* newURI) = 0;
00185
00187 virtual NodeSetOrdering getNodeSetOrdering() const = 0;
00189 virtual void setNodeSetOrdering(NodeSetOrdering newOrder) = 0;
00190
00192 virtual ConstructionMode getConstructionMode() const = 0;
00194 virtual void setConstructionMode(ConstructionMode newMode) = 0;
00195
00197 virtual void setPreserveBoundarySpace(bool value) = 0;
00199 virtual bool getPreserveBoundarySpace() const = 0;
00200
00202 virtual FLWOROrderingMode getDefaultFLWOROrderingMode() const = 0;
00204 virtual void setDefaultFLWOROrderingMode(FLWOROrderingMode newMode) = 0;
00205
00207 virtual void setInheritNamespaces(bool value) = 0;
00209 virtual bool getInheritNamespaces() const = 0;
00210
00212 virtual void setPreserveNamespaces(bool value) = 0;
00214 virtual bool getPreserveNamespaces() const = 0;
00215
00217 virtual void setRevalidationMode(DocumentCache::ValidationMode mode) = 0;
00219 virtual DocumentCache::ValidationMode getRevalidationMode() const = 0;
00220
00222 virtual void setMessageListener(MessageListener *listener) = 0;
00224 virtual MessageListener *getMessageListener() const = 0;
00225
00227
00229
00243 virtual bool getProjection() const = 0;
00260 virtual void setProjection(bool enabled) = 0;
00261
00263 virtual const XMLCh *allocateTempVarName() = 0;
00264
00266 virtual XPath2MemoryManager* getMemoryManager() const = 0;
00268 virtual void setMemoryManager(XPath2MemoryManager* memMgr) = 0;
00269 };
00270
00271 #endif