Xalan-C++ API Reference  1.12.0
XPathEnvSupport.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XPATHENVSUPPORT_HEADER_GUARD_1357924680)
19 #define XPATHENVSUPPORT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
33 
34 
35 
36 namespace XERCES_CPP_NAMESPACE
37 {
38  class Locator;
39 }
40 
41 
42 
43 namespace XALAN_CPP_NAMESPACE {
44 
45 
46 
47 class NodeRefListBase;
48 class PrefixResolver;
49 class XObject;
50 class XPathExecutionContext;
51 class XObjectFactory;
52 class XalanDocument;
53 class XalanDOMString;
54 class XalanElement;
55 class XalanNode;
56 class XalanQName;
57 
58 
59 
61 {
62 public:
63 
64  typedef xercesc::Locator LocatorType;
65 
67 
69 
70  virtual
71  ~XPathEnvSupport();
72 
73 
74  // These methods are inherited from ProblemListener ...
75  virtual void
76  problem(
77  eSource source,
78  eClassification classification,
79  const XalanDOMString& msg,
80  const Locator* locator,
81  const XalanNode* sourceNode) = 0;
82 
83  virtual void
84  problem(
85  eSource source,
86  eClassification classification,
87  const XalanDOMString& msg,
88  const XalanNode* sourceNode) = 0;
89 
90 
91  // These interfaces are new to XPathEnvSupport
92  /**
93  * Provides support for XML parsing service.
94  *
95  * @param theManager The MemoryManager instance to use.
96  * @param urlString location of the XML
97  * @param base base location for URI
98  * @param theErrorHandler An optional ErrorHandler instance for error reporting.
99  * @return parsed document
100  */
101  virtual XalanDocument*
102  parseXML(
103  MemoryManager& theManager,
104  const XalanDOMString& urlString,
105  const XalanDOMString& base,
106  ErrorHandler* theErrorHandler = 0) = 0;
107 
108  /**
109  * Get the source document for the given URI.
110  *
111  * @param theURI document URI
112  * @return source document
113  */
114  virtual XalanDocument*
115  getSourceDocument(const XalanDOMString& theURI) const = 0;
116 
117  /**
118  * Associate a document with a given URI.
119  *
120  * @param theURI document URI
121  * @param theDocument source document
122  */
123  virtual void
124  setSourceDocument(
125  const XalanDOMString& theURI,
126  XalanDocument* theDocument) = 0;
127 
128  /**
129  * Given a DOM Document, tell what URI was used to parse it. Needed for
130  * relative resolution.
131  *
132  * @param owner source document
133  * @return document URI
134  */
135  virtual const XalanDOMString&
136  findURIFromDoc(const XalanDocument* owner) const = 0;
137 
138  /**
139  * Determine if an external element is available.
140  *
141  * @param theNamespace namespace for the element
142  * @param elementName name of extension element
143  * @return whether the element is available or not
144  */
145  virtual bool
146  elementAvailable(
147  const XalanDOMString& theNamespace,
148  const XalanDOMString& elementName) const = 0;
149 
150  /**
151  * Determine if a function is available. For standard
152  * function availability, theNamespace should be an
153  * empty string.
154  *
155  * @param theNamespace namespace for the function
156  * @param functionName name of the function
157  * @return whether the function is available or not
158  */
159  virtual bool
160  functionAvailable(
161  const XalanDOMString& theNamespace,
162  const XalanDOMString& functionName) const = 0;
163 
164  /**
165  * Handle an extension function.
166  *
167  * @param executionContext current execution context
168  * @param theNamespace namespace of function
169  * @param functionName extension function name
170  * @param argVec vector of arguments to function
171  * @param locator A Locator instance for error reporting.
172  * @return pointer to XObject result
173  */
174  virtual XObjectPtr
175  extFunction(
176  XPathExecutionContext& executionContext,
177  const XalanDOMString& theNamespace,
178  const XalanDOMString& functionName,
179  XalanNode* context,
180  const XObjectArgVectorType& argVec,
181  const Locator* locator) const = 0;
182 
183  /**
184  * Reset the instance.
185  */
186  virtual void
187  reset() = 0;
188 
189 private:
190 
191  // These are not implemented...
193 
195  operator=(const XPathEnvSupport&);
196 
197  bool
198  operator==(const XPathEnvSupport&) const;
199 };
200 
201 
202 
203 }
204 
205 
206 
207 #endif // XPATHENVSUPPORT_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XalanVector< XObjectPtr >
xalanc::XalanDocument
Definition: XalanDocument.hpp:36
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
xalanc::XObjectPtr
Class to hold XObjectPtr return types.
Definition: XObject.hpp:883
xalanc::XPathEnvSupport::XObjectArgVectorType
Function::XObjectArgVectorType XObjectArgVectorType
Definition: XPathEnvSupport.hpp:66
xalanc::ProblemListenerBase::eSource
eSource
Definition: ProblemListenerBase.hpp:62
xalanc::ProblemListenerBase::eClassification
eClassification
Definition: ProblemListenerBase.hpp:75
xalanc::XPathEnvSupport::LocatorType
xercesc::Locator LocatorType
Definition: XPathEnvSupport.hpp:64
xalanc::XPathEnvSupport
Definition: XPathEnvSupport.hpp:60
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:82
xalanc::ProblemListenerBase
This is the abstract class that is used when reporting a problem some kind, that requires a message,...
Definition: ProblemListenerBase.hpp:56
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
Function.hpp
ProblemListenerBase.hpp
XPathDefinitions.hpp