Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XPathExecutionContextDefault.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
17 #define XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
28 
29 
30 
32 
33 
34 
38 // Base class include file.
40 
41 
42 
44 
45 
46 
49 
50 
51 
52 XALAN_CPP_NAMESPACE_BEGIN
53 
54 
55 
56 class DOMSupport;
57 class XPathEnvSupport;
58 class XalanQName;
59 
60 
61 
66 {
67 public:
68 
71 
83  XPathEnvSupport& theXPathEnvSupport,
84  DOMSupport& theDOMSupport,
85  XObjectFactory& theXObjectFactory,
86  XalanNode* theCurrentNode = 0,
87  const NodeRefListBase* theContextNodeList = 0,
88  const PrefixResolver* thePrefixResolver = 0);
89 
99  explicit
101  MemoryManagerType& theManager,
102  XalanNode* theCurrentNode = 0,
103  const NodeRefListBase* theContextNodeList = 0,
104  const PrefixResolver* thePrefixResolver = 0);
105 
107  create(
108  MemoryManagerType& theManager,
109  XalanNode* theCurrentNode = 0,
110  const NodeRefListBase* theContextNodeList = 0,
111  const PrefixResolver* thePrefixResolver = 0);
112 
113  virtual
115 
116 
124  {
125  return m_xpathEnvSupport;
126  }
127 
133  void
135  {
136  m_xpathEnvSupport = theSupport;
137  }
138 
144  void
145  setDOMSupport(DOMSupport* theDOMSupport)
146  {
147  m_domSupport = theDOMSupport;
148  }
149 
155  void
156  setXObjectFactory(XObjectFactory* theXObjectFactory)
157  {
158  m_xobjectFactory = theXObjectFactory;
159  }
160 
168  {
169 #if defined(XALAN_NO_MUTABLE)
170  return ((XPathExecutionContextDefault*)this)->m_scratchQName;
171 #else
172  return m_scratchQName;
173 #endif
174  }
175 
176  virtual void doFormatNumber(
177  double number,
178  const XalanDOMString& pattern,
179  const XalanDecimalFormatSymbols* theDFS,
180  XalanDOMString& theResult,
181  const XalanNode* context = 0,
182  const LocatorType* locator = 0);
183 
184  // These interfaces are inherited from XPathExecutionContext...
185 
186  virtual void
187  reset();
188 
189  virtual XalanNode*
190  getCurrentNode() const;
191 
192  virtual void
193  pushCurrentNode(XalanNode* theCurrentNode);
194 
195  virtual void
196  popCurrentNode();
197 
198  virtual bool
199  isNodeAfter(
200  const XalanNode& node1,
201  const XalanNode& node2) const;
202 
203  virtual void
204  pushContextNodeList(const NodeRefListBase& theList);
205 
206  virtual void
208 
209  virtual const NodeRefListBase&
210  getContextNodeList() const;
211 
212  virtual size_type
213  getContextNodeListLength() const;
214 
215  virtual size_type
216  getContextNodeListPosition(const XalanNode& contextNode) const;
217 
218  virtual bool
219  elementAvailable(const XalanQName& theQName) const;
220 
221  virtual bool
223  const XalanDOMString& theName,
224  const LocatorType* locator) const;
225 
226  virtual bool
227  functionAvailable(const XalanQName& theQName) const;
228 
229  virtual bool
231  const XalanDOMString& theName,
232  const LocatorType* locator) const;
233 
234  virtual const XObjectPtr
235  extFunction(
236  const XalanDOMString& theNamespace,
237  const XalanDOMString& functionName,
238  XalanNode* context,
239  const XObjectArgVectorType& argVec,
240  const LocatorType* locator);
241 
242  virtual XalanDocument*
243  parseXML(
244  MemoryManagerType& theManager,
245  const XalanDOMString& urlString,
246  const XalanDOMString& base) const;
247 
248  virtual MutableNodeRefList*
250 
251  virtual bool
253 
254  virtual MutableNodeRefList*
255  createMutableNodeRefList(MemoryManagerType& theManager) const;
256 
257  virtual XalanDOMString&
258  getCachedString();
259 
260  virtual bool
262 
263  virtual void
265  XalanDocument* doc,
266  const XalanQName& qname,
267  const XalanDOMString& ref,
268  MutableNodeRefList& nodelist);
269 
270  virtual void
272  XalanDocument* doc,
273  const XalanDOMString& name,
274  const XalanDOMString& ref,
275  const LocatorType* locator,
276  MutableNodeRefList& nodelist);
277 
278  virtual const XObjectPtr
279  getVariable(
280  const XalanQName& name,
281  const LocatorType* locator = 0);
282 
283  virtual const PrefixResolver*
284  getPrefixResolver() const;
285 
286  virtual void
287  setPrefixResolver(const PrefixResolver* thePrefixResolver);
288 
289  virtual const XalanDOMString*
290  getNamespaceForPrefix(const XalanDOMString& prefix) const;
291 
292  virtual const XalanDOMString&
293  findURIFromDoc(const XalanDocument* owner) const;
294 
295  virtual const XalanDOMString&
297  const XalanDOMString& theName,
298  const XalanDocument& theDocument) const;
299 
300  virtual bool
301  shouldStripSourceNode(const XalanText& node);
302 
303  virtual XalanDocument*
304  getSourceDocument(const XalanDOMString& theURI) const;
305 
306  virtual void
308  const XalanDOMString& theURI,
309  XalanDocument* theDocument);
310 
311  // These interfaces are inherited from ExecutionContext...
312 
313  virtual void formatNumber(
314  double number,
315  const XalanDOMString& pattern,
316  XalanDOMString& theResult,
317  const XalanNode* context = 0,
318  const LocatorType* locator = 0);
319 
320  virtual void formatNumber(
321  double number,
322  const XalanDOMString& pattern,
323  const XalanDOMString& dfsName,
324  XalanDOMString& theResult,
325  const XalanNode* context = 0,
326  const LocatorType* locator = 0);
327 
328 
329  virtual void
330  error(
331  const XalanDOMString& msg,
332  const XalanNode* sourceNode = 0,
333  const LocatorType* locator = 0) const;
334 
335  virtual void
336  warn(
337  const XalanDOMString& msg,
338  const XalanNode* sourceNode = 0,
339  const LocatorType* locator = 0) const;
340 
341  virtual void
342  message(
343  const XalanDOMString& msg,
344  const XalanNode* sourceNode = 0,
345  const LocatorType* locator = 0) const;
346 
347 protected:
348 
350 
351  enum { eNodeListCacheListSize = 50 };
352 
354  {
356  m_node(0),
357  m_index(0)
358  {
359  }
360 
361  void
363  {
364  if (m_node != 0)
365  {
366  m_node = 0;
367  }
368  }
369 
371 
373  };
374 
376 
378 
380 
382 
384 
386 
388 
390 
392 
394 
395  static const NodeRefList s_dummyList;
396 };
397 
398 
399 
400 XALAN_CPP_NAMESPACE_END
401 
402 
403 
404 #endif // XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
XalanQNameByValue & getScratchQName() const
Get a reference to the scratch QNameByValue instance.
Definition: XPathExecutionContextDefault.hpp:167
virtual void setPrefixResolver(const PrefixResolver *thePrefixResolver)=0
Change the resolver for namespaces.
virtual void pushContextNodeList(const NodeRefListBase &theList)=0
Push the node list for current context.
Definition: XalanObjectCache.hpp:265
virtual MutableNodeRefList * borrowMutableNodeRefList()=0
Borrow a cached MutableNodeRefList instance.
virtual bool shouldStripSourceNode(const XalanText &node)=0
Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node.
void setXObjectFactory(XObjectFactory *theXObjectFactory)
Set the XObjectFactory instance.
Definition: XPathExecutionContextDefault.hpp:156
Definition: XalanNode.hpp:44
Definition: XalanText.hpp:38
const PrefixResolver * m_prefixResolver
Definition: XPathExecutionContextDefault.hpp:383
virtual void message(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Output a message.
virtual bool returnMutableNodeRefList(MutableNodeRefList *theList)=0
Return a previously borrowed MutableNodeRefList instance.
Local implementation of MutableNodeRefList.
Definition: MutableNodeRefList.hpp:44
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
NodeListCacheType m_nodeListCache
Definition: XPathExecutionContextDefault.hpp:387
void setXPathEnvSupport(XPathEnvSupport *theSupport)
Set the XPathEnvSupport instance.
Definition: XPathExecutionContextDefault.hpp:134
XalanVector< const NodeRefListBase * > ContextNodeListStackType
Definition: XPathExecutionContextDefault.hpp:70
XPathEnvSupport * getXPathEnvSupport() const
Get the XPathEnvSupport instance.
Definition: XPathExecutionContextDefault.hpp:123
Definition: DOMSupport.hpp:39
virtual const PrefixResolver * getPrefixResolver() const =0
Retrieve the resolver for namespaces.
virtual const NodeRefListBase & getContextNodeList() const =0
Get the node list for current context.
virtual void pushCurrentNode(XalanNode *theCurrentNode)=0
Change the node currently being executed.
virtual void reset()=0
Reset the instance.
Local implementation of NodeRefList.
Definition: NodeRefList.hpp:41
virtual bool releaseCachedString(XalanDOMString &theString)=0
Return a cached string.
XPathEnvSupport * m_xpathEnvSupport
Definition: XPathExecutionContextDefault.hpp:375
Definition: XalanDecimalFormatSymbols.hpp:38
Class to hold XObjectPtr return types.
Definition: XObject.hpp:584
XalanQNameByValue m_scratchQName
Definition: XPathExecutionContextDefault.hpp:393
virtual MutableNodeRefList * createMutableNodeRefList(MemoryManagerType &theManager) const =0
Create a MutableNodeRefList with the appropriate context.
Definition: XPathExecutionContext.hpp:72
DOMSupport * m_domSupport
Definition: XPathExecutionContextDefault.hpp:377
A basic implementation of the class XPathExecutionContext.
Definition: XPathExecutionContextDefault.hpp:65
static const NodeRefList s_dummyList
Definition: XPathExecutionContextDefault.hpp:395
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:42
virtual void setSourceDocument(const XalanDOMString &theURI, XalanDocument *theDocument)=0
Associate a document with a given URI.
ContextNodeListPositionCache m_cachedPosition
Definition: XPathExecutionContextDefault.hpp:391
size_type m_index
Definition: XPathExecutionContextDefault.hpp:372
virtual void popCurrentNode()=0
Reset the node currently being executed.
virtual const XObjectPtr extFunction(const XalanDOMString &theNamespace, const XalanDOMString &functionName, XalanNode *context, const XObjectArgVectorType &argVec, const LocatorType *locator)=0
Handle an extension function.
Definition: XalanDOMStringCache.hpp:42
virtual size_type getContextNodeListLength() const =0
virtual XalanDocument * getSourceDocument(const XalanDOMString &theURI) const =0
Get the document associated with the given URI.
virtual bool isNodeAfter(const XalanNode &node1, const XalanNode &node2) const =0
Determine if a node is after another node, in document order.
virtual void popContextNodeList()=0
Pop the node list for current context.
XalanObjectCache< MutableNodeRefList, DefaultCacheCreateFunctorMemMgr< MutableNodeRefList >, DeleteFunctor< MutableNodeRefList >, ClearCacheResetFunctor< MutableNodeRefList > > NodeListCacheType
Definition: XPathExecutionContextDefault.hpp:349
void clear()
Definition: XPathExecutionContextDefault.hpp:362
Definition: XPathEnvSupport.hpp:62
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
XalanDOMString m_currentPattern
Definition: XPathExecutionContextDefault.hpp:385
Definition: XPathExecutionContextDefault.hpp:353
virtual bool elementAvailable(const XalanQName &theQName) const =0
Determine if an external element is available.
virtual XalanNode * getCurrentNode() const =0
Retrieve the node currently being executed.
This class defines an interface for classes that resolve namespace prefixes to their URIs...
Definition: PrefixResolver.hpp:37
virtual XalanDOMString & getCachedString()=0
Get a cached string for temporary use.
virtual const XalanDOMString & getUnparsedEntityURI(const XalanDOMString &theName, const XalanDocument &theDocument) const =0
The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in t...
virtual void warn(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Report a warning.
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: FormatterListener.hpp:47
Definition: XalanDocument.hpp:51
void setDOMSupport(DOMSupport *theDOMSupport)
Set the DOMSupport instance.
Definition: XPathExecutionContextDefault.hpp:145
virtual const XalanDOMString & findURIFromDoc(const XalanDocument *owner) const =0
Given a DOM Document, tell what URI was used to parse it.
virtual bool functionAvailable(const XalanQName &theQName) const =0
Determine if a function is available.
virtual void getNodeSetByKey(XalanDocument *doc, const XalanQName &qname, const XalanDOMString &ref, MutableNodeRefList &nodelist)=0
Given a valid element key, return the corresponding node list.
Definition: XalanQNameByValue.hpp:43
Definition: XalanDOMString.hpp:42
ContextNodeListStackType m_contextNodeListStack
Definition: XPathExecutionContextDefault.hpp:381
virtual size_type getContextNodeListPosition(const XalanNode &contextNode) const =0
XalanVector< XalanNode * > CurrentNodeStackType
Definition: XPathExecutionContextDefault.hpp:69
virtual const XObjectPtr getVariable(const XalanQName &name, const LocatorType *locator=0)=0
Given a name, locate a variable in the current context, and return a pointer to the object...
virtual void formatNumber(double number, const XalanDOMString &pattern, XalanDOMString &theResult, const XalanNode *context=0, const LocatorType *locator=0)=0
Formats a number according to the specified pattern.
virtual XalanDocument * parseXML(MemoryManagerType &theManager, const XalanDOMString &urlString, const XalanDOMString &base) const =0
Provides support for XML parsing service.
virtual void error(const XalanDOMString &msg, const XalanNode *sourceNode=0, const LocatorType *locator=0) const =0
Report an error and throw an exception.
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:33
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactory.hpp:51
Class to represent a qualified name: "The name of an internal XSLT object, specifically a named templ...
Definition: XalanQName.hpp:68
const XalanNode * m_node
Definition: XPathExecutionContextDefault.hpp:370
virtual const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix) const =0
Retrieve the URI corresponding to a namespace prefix.
CurrentNodeStackType m_currentNodeStack
Definition: XPathExecutionContextDefault.hpp:379
ContextNodeListPositionCache()
Definition: XPathExecutionContextDefault.hpp:355
XalanDOMStringCache m_stringCache
Definition: XPathExecutionContextDefault.hpp:389

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo