00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 * 00057 * $ Id: $ 00058 * 00059 * 00060 * @author <a href="mailto:david_n_bertoni@lotus.com">David N. Bertoni</a> 00061 */ 00062 #if !defined(XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680) 00063 #define XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680 00064 00065 00066 00067 // Base include file. Must be first. 00068 #include <XPath/XPathDefinitions.hpp> 00069 00070 00071 00072 #include <deque> 00073 00074 00075 00076 #include <Include/XalanObjectCache.hpp> 00077 00078 00079 00080 #include <XalanDOM/XalanDOMString.hpp> 00081 00082 00083 00084 // Base class include file. 00085 #include <XPath/XPathExecutionContext.hpp> 00086 00087 00088 00089 #include <PlatformSupport/XalanDOMStringCache.hpp> 00090 00091 00092 00093 #include <XPath/MutableNodeRefList.hpp> 00094 #include <XPath/ResultTreeFrag.hpp> 00095 00096 00097 00098 class DOMSupport; 00099 class XPathEnvSupport; 00100 00101 00102 00106 class XALAN_XPATH_EXPORT XPathExecutionContextDefault : public XPathExecutionContext 00107 { 00108 public: 00109 00120 XPathExecutionContextDefault( 00121 XPathEnvSupport& theXPathEnvSupport, 00122 DOMSupport& theDOMSupport, 00123 XObjectFactory& theXObjectFactory, 00124 XalanNode* theCurrentNode = 0, 00125 const NodeRefListBase* theContextNodeList = 0, 00126 const PrefixResolver* thePrefixResolver = 0); 00127 00137 explicit 00138 XPathExecutionContextDefault( 00139 XalanNode* theCurrentNode = 0, 00140 const NodeRefListBase* theContextNodeList = 0, 00141 const PrefixResolver* thePrefixResolver = 0); 00142 00143 virtual 00144 ~XPathExecutionContextDefault(); 00145 00146 00152 void 00153 setXPathEnvSupport(XPathEnvSupport* theSupport) 00154 { 00155 m_xpathEnvSupport = theSupport; 00156 } 00157 00163 void 00164 setXObjectFactory(XObjectFactory* theFactory) 00165 { 00166 m_xobjectFactory = theFactory; 00167 } 00168 00174 void 00175 setDOMSupport(DOMSupport* theDOMSupport) 00176 { 00177 m_domSupport = theDOMSupport; 00178 } 00179 00180 00181 // These interfaces are inherited from XPathExecutionContext... 00182 00183 virtual void 00184 reset(); 00185 00186 virtual XalanNode* 00187 getCurrentNode() const; 00188 00189 virtual void 00190 setCurrentNode(XalanNode* theCurrentNode); 00191 00192 virtual XObjectFactory& 00193 getXObjectFactory() const; 00194 00195 virtual XObjectPtr 00196 createNodeSet(XalanNode& theNode); 00197 00198 virtual bool 00199 isNodeAfter( 00200 const XalanNode& node1, 00201 const XalanNode& node2) const; 00202 00203 virtual const NodeRefListBase& 00204 getContextNodeList() const; 00205 00206 virtual void 00207 setContextNodeList(const NodeRefListBase& theList); 00208 00209 virtual unsigned int 00210 getContextNodeListLength() const; 00211 00212 virtual unsigned int 00213 getContextNodeListPosition(const XalanNode& contextNode) const; 00214 00215 virtual bool 00216 elementAvailable( 00217 const XalanDOMString& theNamespace, 00218 const XalanDOMString& elementName) const; 00219 00220 virtual bool 00221 functionAvailable( 00222 const XalanDOMString& theNamespace, 00223 const XalanDOMString& functionName) const; 00224 00225 virtual const XObjectPtr 00226 extFunction( 00227 const XalanDOMString& theNamespace, 00228 const XalanDOMString& functionName, 00229 XalanNode* context, 00230 const XObjectArgVectorType& argVec); 00231 00232 virtual XalanDocument* 00233 parseXML( 00234 const XalanDOMString& urlString, 00235 const XalanDOMString& base) const; 00236 00237 virtual MutableNodeRefList* 00238 borrowMutableNodeRefList(); 00239 00240 virtual bool 00241 returnMutableNodeRefList(MutableNodeRefList* theList); 00242 00243 virtual ResultTreeFragBase* 00244 borrowResultTreeFrag(); 00245 00246 virtual bool 00247 returnResultTreeFrag(ResultTreeFragBase* theResultTreeFragBase); 00248 00249 virtual MutableNodeRefList* 00250 createMutableNodeRefList() const; 00251 00252 virtual XalanDOMString& 00253 getCachedString(); 00254 00255 virtual bool 00256 releaseCachedString(XalanDOMString& theString); 00257 00258 virtual void 00259 getNodeSetByKey( 00260 XalanNode* doc, 00261 const XalanDOMString& name, 00262 const XalanDOMString& ref, 00263 const PrefixResolver& resolver, 00264 MutableNodeRefList& nodelist); 00265 00266 virtual const XObjectPtr 00267 getVariable(const XalanQName& name); 00268 00269 virtual const PrefixResolver* 00270 getPrefixResolver() const; 00271 00272 virtual void 00273 setPrefixResolver(const PrefixResolver* thePrefixResolver); 00274 00275 virtual const XalanDOMString* 00276 getNamespaceForPrefix(const XalanDOMString& prefix) const; 00277 00278 virtual XalanDocument* 00279 getDOMFactory() const; 00280 00281 virtual XalanDOMString 00282 findURIFromDoc(const XalanDocument* owner) const; 00283 00284 virtual const XalanDOMString& 00285 getUnparsedEntityURI( 00286 const XalanDOMString& theName, 00287 const XalanDocument& theDocument) const; 00288 00289 virtual bool 00290 shouldStripSourceNode(const XalanNode& node); 00291 00292 virtual bool 00293 getThrowFoundIndex() const; 00294 00295 virtual void 00296 setThrowFoundIndex(bool fThrow); 00297 00298 virtual XalanDocument* 00299 getSourceDocument(const XalanDOMString& theURI) const; 00300 00301 virtual void 00302 setSourceDocument( 00303 const XalanDOMString& theURI, 00304 XalanDocument* theDocument); 00305 00306 virtual const XalanDecimalFormatSymbols* 00307 getDecimalFormatSymbols(const XalanDOMString& name); 00308 00309 00310 // These interfaces are inherited from ExecutionContext... 00311 00312 virtual void 00313 error( 00314 const XalanDOMString& msg, 00315 const XalanNode* sourceNode = 0, 00316 const XalanNode* styleNode = 0) const; 00317 00318 virtual void 00319 error( 00320 const XalanDOMString& msg, 00321 const XalanNode* sourceNode, 00322 const Locator* locator) const; 00323 00324 virtual void 00325 error( 00326 const char* msg, 00327 const XalanNode* sourceNode = 0, 00328 const XalanNode* styleNode = 0) const; 00329 00330 virtual void 00331 error( 00332 const char* msg, 00333 const XalanNode* sourceNode, 00334 const Locator* locator) const; 00335 00336 virtual void 00337 warn( 00338 const XalanDOMString& msg, 00339 const XalanNode* sourceNode = 0, 00340 const XalanNode* styleNode = 0) const; 00341 00342 virtual void 00343 warn( 00344 const XalanDOMString& msg, 00345 const XalanNode* sourceNode, 00346 const Locator* locator) const; 00347 00348 virtual void 00349 warn( 00350 const char* msg, 00351 const XalanNode* sourceNode = 0, 00352 const XalanNode* styleNode = 0) const; 00353 00354 virtual void 00355 warn( 00356 const char* msg, 00357 const XalanNode* sourceNode, 00358 const Locator* locator) const; 00359 00360 virtual void 00361 message( 00362 const XalanDOMString& msg, 00363 const XalanNode* sourceNode = 0, 00364 const XalanNode* styleNode = 0) const; 00365 00366 virtual void 00367 message( 00368 const XalanDOMString& msg, 00369 const XalanNode* sourceNode, 00370 const Locator* locator) const; 00371 00372 virtual void 00373 message( 00374 const char* msg, 00375 const XalanNode* sourceNode = 0, 00376 const XalanNode* styleNode = 0) const; 00377 00378 virtual void 00379 message( 00380 const char* msg, 00381 const XalanNode* sourceNode, 00382 const Locator* locator) const; 00383 00384 protected: 00385 00386 typedef XalanObjectCache<MutableNodeRefList, DefaultCacheCreateFunctor<MutableNodeRefList>, DeleteFunctor<MutableNodeRefList>, ClearCacheResetFunctor<MutableNodeRefList> > NodeListCacheType; 00387 typedef XalanObjectCache<ResultTreeFragBase, DefaultCacheCreateFunctor<ResultTreeFrag>, DeleteFunctor<ResultTreeFragBase>, ClearCacheResetFunctor<ResultTreeFragBase> > ResultTreeFragCacheType; 00388 00389 enum { eNodeListCacheListSize = 50, 00390 eResultTreeFragCacheListSize = 50 }; 00391 00392 XPathEnvSupport* m_xpathEnvSupport; 00393 00394 DOMSupport* m_domSupport; 00395 00396 XObjectFactory* m_xobjectFactory; 00397 00398 XalanNode* m_currentNode; 00399 00400 const NodeRefListBase* m_contextNodeList; 00401 00402 const PrefixResolver* m_prefixResolver; 00403 00404 bool m_throwFoundIndex; 00405 00406 XalanDOMString m_currentPattern; 00407 00408 NodeListCacheType m_nodeListCache; 00409 00410 ResultTreeFragCacheType m_resultTreeFragCache; 00411 00412 XalanDOMStringCache m_stringCache; 00413 00414 static const NodeRefList s_dummyList; 00415 }; 00416 00417 00418 00419 #endif // XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.1 |
|