00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _DOCUMENTCACHE_HPP
00023 #define _DOCUMENTCACHE_HPP
00024
00025 #include <vector>
00026
00027 #include <xqilla/framework/XPath2MemoryManager.hpp>
00028 #include <xqilla/items/Node.hpp>
00029
00030 #include <xercesc/util/XercesDefs.hpp>
00031 #include <xercesc/util/XMemory.hpp>
00032
00033 class DynamicContext;
00034 class StaticContext;
00035 class QualifiedName;
00036 class LocationInfo;
00037 class QueryPathNode;
00038
00039 typedef std::vector<const XMLCh*, XQillaAllocator<const XMLCh*> > VectorOfStrings;
00040
00041 XERCES_CPP_NAMESPACE_BEGIN
00042 class DOMDocument;
00043 class DOMNode;
00044 class DatatypeValidator;
00045 class XMLEntityResolver;
00046 class ComplexTypeInfo;
00047 class SchemaElementDecl;
00048 class SchemaAttDef;
00049 class InputSource;
00050 class GrammarResolver;
00051 XERCES_CPP_NAMESPACE_END
00052
00054 class XQILLA_API DocumentCache : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
00055 {
00056 public:
00058 static const XMLCh g_szUntyped[];
00059
00060 enum ValidationMode {
00061 VALIDATION_STRICT = 0,
00062 VALIDATION_LAX = 1,
00063 VALIDATION_SKIP = 2
00064 };
00065
00067 virtual ~DocumentCache() {}
00068
00070 virtual Node::Ptr loadDocument(const XMLCh* uri, DynamicContext *context, const QueryPathNode *projection = 0) = 0;
00072 virtual Node::Ptr parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse, DynamicContext *context, const QueryPathNode *projection = 0) = 0;
00074 virtual void parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse, EventHandler *handler, DynamicContext *context) = 0;
00075
00081 virtual void setXMLEntityResolver(XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* const handler) = 0;
00082 virtual XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* getXMLEntityResolver() const = 0;
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 virtual bool isTypeOrDerivedFromType(const XMLCh* const uri, const XMLCh* const typeName, const XMLCh* const uriToCheck, const XMLCh* const typeNameToCheck) const = 0;
00094 virtual bool isTypeDefined(const XMLCh* const uri, const XMLCh* const typeName) const = 0;
00095
00096 virtual void addSchemaLocation(const XMLCh* uri, VectorOfStrings* locations, StaticContext *context, const LocationInfo *location) = 0;
00097
00099 virtual unsigned int getSchemaUriId(const XMLCh* uri) const = 0;
00100 virtual const XMLCh* getSchemaUri(unsigned int id) const = 0;
00101
00102 virtual XERCES_CPP_NAMESPACE_QUALIFIER GrammarResolver *getGrammarResolver() const = 0;
00103
00104 virtual XERCES_CPP_NAMESPACE_QUALIFIER DatatypeValidator* getDatatypeValidator(const XMLCh* uri, const XMLCh* typeName) const = 0;
00105
00106 virtual XERCES_CPP_NAMESPACE_QUALIFIER ComplexTypeInfo* getComplexTypeInfo(const XMLCh* uri, const XMLCh* typeName) const = 0;
00107
00108 virtual XERCES_CPP_NAMESPACE_QUALIFIER SchemaElementDecl* getElementDecl(const XMLCh* elementUri, const XMLCh* elementName) const = 0;
00109
00110 virtual XERCES_CPP_NAMESPACE_QUALIFIER SchemaAttDef* getAttributeDecl(const XMLCh* attributeUri, const XMLCh* attributeName) const = 0;
00111
00112 virtual DocumentCache *createDerivedCache(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr) const = 0;
00113 };
00114
00115 #endif
00116
00117
00118
00119
00120
00121
00122