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 00095 00096 00097 class DOMSupport; 00098 class XPathEnvSupport; 00099 class XalanQName; 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 setDOMSupport(DOMSupport* theDOMSupport) 00165 { 00166 m_domSupport = theDOMSupport; 00167 } 00168 00174 void 00175 setXObjectFactory(XObjectFactory* theXObjectFactory) 00176 { 00177 m_xobjectFactory = theXObjectFactory; 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 XObjectPtr 00193 createNodeSet(XalanNode& theNode); 00194 00195 virtual bool 00196 isNodeAfter( 00197 const XalanNode& node1, 00198 const XalanNode& node2) const; 00199 00200 virtual const NodeRefListBase& 00201 getContextNodeList() const; 00202 00203 virtual void 00204 setContextNodeList(const NodeRefListBase& theList); 00205 00206 virtual size_type 00207 getContextNodeListLength() const; 00208 00209 virtual size_type 00210 getContextNodeListPosition(const XalanNode& contextNode) const; 00211 00212 virtual bool 00213 elementAvailable( 00214 const XalanDOMString& theNamespace, 00215 const XalanDOMString& elementName) const; 00216 00217 virtual bool 00218 functionAvailable( 00219 const XalanDOMString& theNamespace, 00220 const XalanDOMString& functionName) const; 00221 00222 virtual const XObjectPtr 00223 extFunction( 00224 const XalanDOMString& theNamespace, 00225 const XalanDOMString& functionName, 00226 XalanNode* context, 00227 const XObjectArgVectorType& argVec, 00228 const Locator* locator); 00229 00230 virtual XalanDocument* 00231 parseXML( 00232 const XalanDOMString& urlString, 00233 const XalanDOMString& base) const; 00234 00235 virtual MutableNodeRefList* 00236 borrowMutableNodeRefList(); 00237 00238 virtual bool 00239 returnMutableNodeRefList(MutableNodeRefList* theList); 00240 00241 virtual MutableNodeRefList* 00242 createMutableNodeRefList() const; 00243 00244 virtual XalanDOMString& 00245 getCachedString(); 00246 00247 virtual bool 00248 releaseCachedString(XalanDOMString& theString); 00249 00250 virtual void 00251 getNodeSetByKey( 00252 XalanNode* doc, 00253 const XalanDOMString& name, 00254 const XalanDOMString& ref, 00255 const PrefixResolver& resolver, 00256 MutableNodeRefList& nodelist); 00257 00258 virtual const XObjectPtr 00259 getVariable( 00260 const XalanQName& name, 00261 const Locator* locator = 0); 00262 00263 virtual const PrefixResolver* 00264 getPrefixResolver() const; 00265 00266 virtual void 00267 setPrefixResolver(const PrefixResolver* thePrefixResolver); 00268 00269 virtual const XalanDOMString* 00270 getNamespaceForPrefix(const XalanDOMString& prefix) const; 00271 00272 virtual XalanDOMString 00273 findURIFromDoc(const XalanDocument* owner) const; 00274 00275 virtual const XalanDOMString& 00276 getUnparsedEntityURI( 00277 const XalanDOMString& theName, 00278 const XalanDocument& theDocument) const; 00279 00280 virtual bool 00281 shouldStripSourceNode(const XalanNode& node); 00282 00283 virtual bool 00284 getThrowFoundIndex() const; 00285 00286 virtual void 00287 setThrowFoundIndex(bool fThrow); 00288 00289 virtual XalanDocument* 00290 getSourceDocument(const XalanDOMString& theURI) const; 00291 00292 virtual void 00293 setSourceDocument( 00294 const XalanDOMString& theURI, 00295 XalanDocument* theDocument); 00296 00297 virtual const XalanDecimalFormatSymbols* 00298 getDecimalFormatSymbols(const XalanQName& qname); 00299 00300 00301 // These interfaces are inherited from ExecutionContext... 00302 00303 virtual void 00304 error( 00305 const XalanDOMString& msg, 00306 const XalanNode* sourceNode = 0, 00307 const XalanNode* styleNode = 0) const; 00308 00309 virtual void 00310 error( 00311 const XalanDOMString& msg, 00312 const XalanNode* sourceNode, 00313 const Locator* locator) const; 00314 00315 virtual void 00316 error( 00317 const char* msg, 00318 const XalanNode* sourceNode = 0, 00319 const XalanNode* styleNode = 0) const; 00320 00321 virtual void 00322 error( 00323 const char* msg, 00324 const XalanNode* sourceNode, 00325 const Locator* locator) const; 00326 00327 virtual void 00328 warn( 00329 const XalanDOMString& msg, 00330 const XalanNode* sourceNode = 0, 00331 const XalanNode* styleNode = 0) const; 00332 00333 virtual void 00334 warn( 00335 const XalanDOMString& msg, 00336 const XalanNode* sourceNode, 00337 const Locator* locator) const; 00338 00339 virtual void 00340 warn( 00341 const char* msg, 00342 const XalanNode* sourceNode = 0, 00343 const XalanNode* styleNode = 0) const; 00344 00345 virtual void 00346 warn( 00347 const char* msg, 00348 const XalanNode* sourceNode, 00349 const Locator* locator) const; 00350 00351 virtual void 00352 message( 00353 const XalanDOMString& msg, 00354 const XalanNode* sourceNode = 0, 00355 const XalanNode* styleNode = 0) const; 00356 00357 virtual void 00358 message( 00359 const XalanDOMString& msg, 00360 const XalanNode* sourceNode, 00361 const Locator* locator) const; 00362 00363 virtual void 00364 message( 00365 const char* msg, 00366 const XalanNode* sourceNode = 0, 00367 const XalanNode* styleNode = 0) const; 00368 00369 virtual void 00370 message( 00371 const char* msg, 00372 const XalanNode* sourceNode, 00373 const Locator* locator) const; 00374 00375 protected: 00376 00377 typedef XalanObjectCache<MutableNodeRefList, DefaultCacheCreateFunctor<MutableNodeRefList>, DeleteFunctor<MutableNodeRefList>, ClearCacheResetFunctor<MutableNodeRefList> > NodeListCacheType; 00378 00379 enum { eNodeListCacheListSize = 50 }; 00380 00381 XPathEnvSupport* m_xpathEnvSupport; 00382 00383 DOMSupport* m_domSupport; 00384 00385 XalanNode* m_currentNode; 00386 00387 const NodeRefListBase* m_contextNodeList; 00388 00389 const PrefixResolver* m_prefixResolver; 00390 00391 bool m_throwFoundIndex; 00392 00393 XalanDOMString m_currentPattern; 00394 00395 NodeListCacheType m_nodeListCache; 00396 00397 XalanDOMStringCache m_stringCache; 00398 00399 static const NodeRefList s_dummyList; 00400 }; 00401 00402 00403 00404 #endif // XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.4 |
|