SourceForge.net Logo
DocumentCache.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001, 2008,
3  * DecisionSoft Limited. All rights reserved.
4  * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef _DOCUMENTCACHE_HPP
21 #define _DOCUMENTCACHE_HPP
22 
23 #include <vector>
24 
26 #include <xqilla/items/Node.hpp>
27 
28 #include <xercesc/util/XercesDefs.hpp>
29 #include <xercesc/util/XMemory.hpp>
30 
31 class DynamicContext;
32 class StaticContext;
33 class QualifiedName;
34 class LocationInfo;
35 class QueryPathNode;
36 
37 typedef std::vector<const XMLCh*, XQillaAllocator<const XMLCh*> > VectorOfStrings;
38 
39 XERCES_CPP_NAMESPACE_BEGIN
40 class DOMDocument;
41 class DOMNode;
42 class DatatypeValidator;
43 class XMLEntityResolver;
44 class ComplexTypeInfo;
45 class SchemaElementDecl;
46 class SchemaAttDef;
47 class InputSource;
48 class GrammarResolver;
49 XERCES_CPP_NAMESPACE_END
50 
52 class XQILLA_API DocumentCache : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
53 {
54 public:
56  static const XMLCh g_szUntyped[];
57 
59  VALIDATION_STRICT = 0,
60  VALIDATION_LAX = 1,
61  VALIDATION_SKIP = 2
62  };
63 
65  virtual ~DocumentCache() {}
66 
68  virtual Node::Ptr loadDocument(const XMLCh* uri, DynamicContext *context, const QueryPathNode *projection = 0) = 0;
70  virtual Node::Ptr parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse, DynamicContext *context, const QueryPathNode *projection = 0) = 0;
72  virtual void parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse, EventHandler *handler, DynamicContext *context) = 0;
73 
79  virtual void setXMLEntityResolver(XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* const handler) = 0;
80  virtual XERCES_CPP_NAMESPACE_QUALIFIER XMLEntityResolver* getXMLEntityResolver() const = 0;
81 
82  virtual bool getDoPSVI() const = 0;
83  virtual void setDoPSVI(bool value) = 0;
84 
85  /*
86  * returns true if the type represented by uri:typename is an instance of uriToCheck:typeNameToCheck
87  *
88  * ie: to check
89  * xs:integer instance of xs:decimal,
90  * call
91  * isTypeOrDerivedFromType("xs", "integer", "xs", "decimal")
92  * (except of course, call with URIs, not prefixes!)
93  */
94  virtual bool isTypeOrDerivedFromType(const XMLCh* const uri, const XMLCh* const typeName, const XMLCh* const uriToCheck, const XMLCh* const typeNameToCheck) const = 0;
95  virtual bool isTypeDefined(const XMLCh* const uri, const XMLCh* const typeName) const = 0;
96 
97  virtual void addSchemaLocation(const XMLCh* uri, VectorOfStrings* locations, StaticContext *context, const LocationInfo *location) = 0;
98 
100  virtual unsigned int getSchemaUriId(const XMLCh* uri) const = 0;
101  virtual const XMLCh* getSchemaUri(unsigned int id) const = 0;
102 
103  virtual XERCES_CPP_NAMESPACE_QUALIFIER GrammarResolver *getGrammarResolver() const = 0;
104 
105  virtual XERCES_CPP_NAMESPACE_QUALIFIER DatatypeValidator* getDatatypeValidator(const XMLCh* uri, const XMLCh* typeName) const = 0;
106 
107  virtual XERCES_CPP_NAMESPACE_QUALIFIER ComplexTypeInfo* getComplexTypeInfo(const XMLCh* uri, const XMLCh* typeName) const = 0;
108 
109  virtual XERCES_CPP_NAMESPACE_QUALIFIER SchemaElementDecl* getElementDecl(const XMLCh* elementUri, const XMLCh* elementName) const = 0;
110 
111  virtual XERCES_CPP_NAMESPACE_QUALIFIER SchemaAttDef* getAttributeDecl(const XMLCh* attributeUri, const XMLCh* attributeName) const = 0;
112 
113  virtual DocumentCache *createDerivedCache(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr) const = 0;
114 };
115 
116 #endif
117 
118 
119 
120 
121 
122 
123 
Expression Context is a storage for contexts.
Definition: DocumentCache.hpp:52
Definition: EventHandler.hpp:29
Super class of all the reference counted wrappers for Items.
Definition: ReferenceCounted.hpp:61
virtual ~DocumentCache()
virtual destructor
Definition: DocumentCache.hpp:65
The parse time static context interface.
Definition: StaticContext.hpp:57
std::vector< const XMLCh *, XQillaAllocator< const XMLCh * > > VectorOfStrings
Definition: DocumentCache.hpp:35
ValidationMode
Definition: DocumentCache.hpp:58
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
A class that gives records a location in the query.
Definition: LocationInfo.hpp:29