Xalan-C++ API Documentation

The Xalan C++ XSL Transformer Version 1.1

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XPathExecutionContextDefault.hpp

Go to the documentation of this file.
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 <XalanDOM/XalanDOMString.hpp>
00077 
00078 
00079 
00080 // Base class include file.
00081 #include <XPath/XPathExecutionContext.hpp>
00082 
00083 
00084 
00085 #include <PlatformSupport/XalanDOMStringCache.hpp>
00086 
00087 
00088 
00089 #include <XPath/NodeRefList.hpp>
00090 
00091 
00092 
00093 class DOMSupport;
00094 class XPathEnvSupport;
00095 
00096 
00097 
00101 class XALAN_XPATH_EXPORT XPathExecutionContextDefault : public XPathExecutionContext
00102 {
00103 public:
00104     
00115     XPathExecutionContextDefault(
00116             XPathEnvSupport&        theXPathEnvSupport,
00117             DOMSupport&             theDOMSupport,
00118             XObjectFactory&         theXObjectFactory,
00119             XalanNode*              theCurrentNode = 0,
00120             const NodeRefListBase*  theContextNodeList = 0,
00121             const PrefixResolver*   thePrefixResolver = 0);
00122 
00123     virtual
00124     ~XPathExecutionContextDefault();
00125 
00126 
00127     // These interfaces are inherited from XPathExecutionContext...
00128 
00129     virtual void
00130     reset();
00131 
00132     virtual XalanNode*
00133     getCurrentNode() const;
00134 
00135     virtual void
00136     setCurrentNode(XalanNode*       theCurrentNode);
00137 
00138     virtual XObjectFactory&
00139     getXObjectFactory() const;
00140 
00141     virtual XObjectPtr
00142     createNodeSet(XalanNode&    theNode);
00143 
00144     virtual bool
00145     isNodeAfter(
00146             const XalanNode&    node1,
00147             const XalanNode&    node2) const;
00148 
00149     virtual const NodeRefListBase&
00150     getContextNodeList() const;
00151 
00152     virtual void    
00153     setContextNodeList(const NodeRefListBase&   theList);
00154 
00155     virtual unsigned int
00156     getContextNodeListLength() const;
00157 
00158     virtual unsigned int
00159     getContextNodeListPosition(const XalanNode&     contextNode) const;
00160 
00161     virtual bool
00162     elementAvailable(
00163             const XalanDOMString&   theNamespace, 
00164             const XalanDOMString&   elementName) const;
00165 
00166     virtual bool
00167     functionAvailable(
00168             const XalanDOMString&   theNamespace, 
00169             const XalanDOMString&   functionName) const;
00170 
00171     virtual const XObjectPtr
00172     extFunction(
00173             const XalanDOMString&           theNamespace,
00174             const XalanDOMString&           functionName,
00175             XalanNode*                      context,
00176             const XObjectArgVectorType&     argVec);
00177 
00178     virtual XLocator*
00179     getXLocatorFromNode(const XalanNode*    node) const;
00180 
00181     virtual void
00182     associateXLocatorToNode(
00183             const XalanNode*    node,
00184             XLocator*           xlocator);
00185 
00186     virtual XalanDocument*
00187     parseXML(
00188             const XalanDOMString&   urlString,
00189             const XalanDOMString&   base) const;
00190 
00191     virtual MutableNodeRefList*
00192     borrowMutableNodeRefList();
00193 
00194     virtual bool
00195     returnMutableNodeRefList(MutableNodeRefList*    theList);
00196 
00197     virtual ResultTreeFragBase*
00198     borrowResultTreeFrag();
00199 
00200     virtual bool
00201     returnResultTreeFrag(ResultTreeFragBase*    theResultTreeFragBase);
00202 
00203     virtual MutableNodeRefList*
00204     createMutableNodeRefList() const;
00205 
00206     virtual XalanDOMString&
00207     getCachedString();
00208 
00209     virtual bool
00210     releaseCachedString(XalanDOMString&     theString);
00211 
00212     virtual void
00213     getNodeSetByKey(
00214             XalanNode*              doc,
00215             const XalanDOMString&   name,
00216             const XalanDOMString&   ref,
00217             const PrefixResolver&   resolver,
00218             MutableNodeRefList&     nodelist);
00219 
00220     virtual const XObjectPtr
00221     getVariable(const QName&    name);
00222 
00223     virtual const PrefixResolver*
00224     getPrefixResolver() const;
00225 
00226     virtual void
00227     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
00228 
00229     virtual const XalanDOMString&
00230     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
00231 
00232     virtual XalanDocument*
00233     getDOMFactory() const;
00234 
00235     virtual XalanDOMString
00236     findURIFromDoc(const XalanDocument*     owner) const;
00237 
00238     virtual const XalanDOMString&
00239     getUnparsedEntityURI(
00240             const XalanDOMString&       theName,
00241             const XalanDocument&        theDocument) const;
00242 
00243     virtual bool
00244     shouldStripSourceNode(const XalanNode&  node);
00245 
00246     virtual bool
00247     getThrowFoundIndex() const;
00248 
00249     virtual void
00250     setThrowFoundIndex(bool     fThrow);
00251 
00252     virtual XalanDocument*
00253     getSourceDocument(const XalanDOMString&     theURI) const;
00254 
00255     virtual void
00256     setSourceDocument(
00257             const XalanDOMString&   theURI,
00258             XalanDocument*          theDocument);
00259 
00260     virtual const XalanDecimalFormatSymbols*
00261     getDecimalFormatSymbols(const XalanDOMString&   name);
00262 
00263 
00264     // These interfaces are inherited from ExecutionContext...
00265 
00266     virtual void
00267     error(
00268             const XalanDOMString&   msg,
00269             const XalanNode*        sourceNode = 0,
00270             const XalanNode*        styleNode = 0) const;
00271 
00272     virtual void
00273     error(
00274             const char*         msg,
00275             const XalanNode*    sourceNode = 0,
00276             const XalanNode*    styleNode = 0) const;
00277 
00278     virtual void
00279     warn(
00280             const XalanDOMString&   msg,
00281             const XalanNode*        sourceNode = 0,
00282             const XalanNode*        styleNode = 0) const;
00283 
00284     virtual void
00285     warn(
00286             const char*         msg,
00287             const XalanNode*    sourceNode = 0,
00288             const XalanNode*    styleNode = 0) const;
00289 
00290     virtual void
00291     message(
00292             const XalanDOMString&   msg,
00293             const XalanNode*        sourceNode = 0,
00294             const XalanNode*        styleNode = 0) const;
00295 
00296     virtual void
00297     message(
00298             const char*         msg,
00299             const XalanNode*    sourceNode = 0,
00300             const XalanNode*    styleNode = 0) const;
00301 
00302 #if defined(XALAN_NO_NAMESPACES)
00303     typedef vector<MutableNodeRefList*>         NodeRefListCacheType;
00304     typedef vector<ResultTreeFragBase*>         ResultTreeFragCacheType;
00305 #else
00306     typedef std::vector<MutableNodeRefList*>    NodeRefListCacheType;
00307     typedef std::vector<ResultTreeFragBase*>    ResultTreeFragCacheType;
00308 #endif
00309 
00310 protected:
00311 
00312     enum { eMutableNodeRefListCacheMax = 50,
00313            eResultTreeFragListCacheMax = 50,
00314            eCachedArgVectorDefaultSize = 10 };
00315 
00316     XPathEnvSupport&            m_xpathEnvSupport;
00317 
00318     DOMSupport&                 m_domSupport;
00319 
00320     XObjectFactory&             m_xobjectFactory;
00321 
00322     XalanNode*                  m_currentNode;
00323 
00324     const NodeRefListBase*      m_contextNodeList;
00325 
00326     const PrefixResolver*       m_prefixResolver;
00327 
00328     bool                        m_throwFoundIndex;
00329 
00330     XalanDOMString              m_currentPattern;
00331 
00332     NodeRefListCacheType        m_availableCachedNodeLists;
00333 
00334     NodeRefListCacheType        m_busyCachedNodeLists;
00335 
00336     ResultTreeFragCacheType     m_availableCachedResultTreeFrags;
00337 
00338     ResultTreeFragCacheType     m_busyCachedResultTreeFrags;
00339 
00340     XalanDOMStringCache         m_stringCache;
00341 
00342     static const NodeRefList    s_dummyList;
00343 };
00344 
00345 
00346 
00347 #endif  // XPATHEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680

Interpreting class diagrams

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

Xalan-C++ XSL Transformer Version 1.1
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.