SourceForge.net Logo

DocumentCache.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2008
00003  *     DecisionSoft Limited. All rights reserved.
00004  * Copyright (c) 2004-2008
00005  *     Oracle. All rights reserved.
00006  *
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  *
00011  *     http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  *
00019  * $Id: DocumentCache.hpp 480 2008-01-29 02:25:38Z jpcs $
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    * returns true if the type represented by uri:typename is an instance of uriToCheck:typeNameToCheck 
00086    *
00087    * ie: to check 
00088    * xs:integer instance of xs:decimal, 
00089    * call
00090    * isTypeOrDerivedFromType("xs", "integer", "xs", "decimal") 
00091    * (except of course, call with URIs, not prefixes!)
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 

Generated on Mon Apr 28 16:40:48 2008 for XQilla Simple API by  doxygen 1.5.1