Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.3

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

StylesheetExecutionContext.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  * @author <a href="mailto:david_n_bertoni@lotus.com">David N. Bertoni</a>
00058  */
00059 #if !defined(STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680)
00060 #define STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680
00061 
00062 
00063 
00064 // Base include file.  Must be first.
00065 #include <XSLT/XSLTDefinitions.hpp>
00066 
00067 
00068 
00069 #if defined(XALAN_OLD_STREAMS)
00070 #include <iostream.h>
00071 #else
00072 #include <iosfwd>
00073 #endif
00074 
00075 
00076 
00077 #include <cstddef>
00078 #include <memory>
00079 
00080 
00081 
00082 // Base class header file...
00083 #include <XPath/XPathExecutionContext.hpp>
00084 
00085 
00086 
00087 #include <XalanDOM/XalanDOMString.hpp>
00088 
00089 
00090 
00091 // Base class header file...
00092 #include <PlatformSupport/ExecutionContext.hpp>
00093 
00094 
00095 
00096 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
00097 #include <PlatformSupport/XalanNumberFormat.hpp>
00098 #endif
00099 
00100 
00101 
00102 #include <Include/XalanAutoPtr.hpp>
00103 
00104 
00105 
00106 #include <PlatformSupport/AttributeListImpl.hpp>
00107 
00108 
00109 
00110 #include <XSLT/KeyTable.hpp>
00111 #include <XSLT/TopLevelArg.hpp>
00112 
00113 
00114 
00115 class CountersTable;
00116 class ElemTemplateElement;
00117 class ElemVariable;
00118 class FormatterListener;
00119 class FormatterToDOM;
00120 class FormatterToHTML;
00121 class FormatterToText;
00122 class FormatterToXML;
00123 class GenerateEvent;
00124 class KeyTable;
00125 class PrefixResolver;
00126 class NodeRefListBase;
00127 class NodeSorter;
00128 class PrintWriter;
00129 class XalanQName;
00130 class SelectionEvent;
00131 class Stylesheet;
00132 class StylesheetRoot;
00133 class XalanOutputStream;
00134 class TracerEvent;
00135 class Writer;
00136 class XalanDocument;
00137 class XalanDocumentFragment;
00138 class XalanElement;
00139 class XalanNode;
00140 class XalanNumberFormat;
00141 class XPath;
00142 class XObject;
00143 class XObjectPtr;
00144 class XResultTreeFrag;
00145 
00146 
00147 
00148 //
00149 // An abstract class which provides support for executing stylesheets.
00150 //
00151 class XALAN_XSLT_EXPORT StylesheetExecutionContext : public XPathExecutionContext
00152 {
00153 public:
00154 
00155     typedef size_t  size_type;
00156 
00157     explicit
00158     StylesheetExecutionContext();
00159 
00160     virtual
00161     ~StylesheetExecutionContext();
00162 
00163     // These interfaces are new...
00164 
00170     virtual bool
00171     getQuietConflictWarnings() const = 0;
00172 
00180     virtual XalanNode*
00181     getRootDocument() const = 0;
00182 
00190     virtual void
00191     setRootDocument(XalanNode*  theDocument) = 0;
00192 
00198     virtual XalanDocument*
00199     createDocument() const = 0;
00200 
00206     virtual void
00207     setStylesheetRoot(const StylesheetRoot*     theStylesheet) = 0;
00208 
00214     virtual const XalanQName*
00215     getCurrentMode() const = 0;
00216 
00222     virtual void
00223     setCurrentMode(const XalanQName* theMode) = 0; 
00224 
00230     virtual bool
00231     doDiagnosticsOutput() const = 0;
00232 
00238     virtual void
00239     diag(const XalanDOMString&  theString) = 0;
00240 
00247     virtual void
00248     pushTime(const void*    theKey) = 0;
00249 
00256     virtual void
00257     displayDuration(
00258             const XalanDOMString&   theMessage,
00259             const void*             theKey) = 0;
00260 
00264     virtual bool
00265     isElementPending() const = 0;
00266 
00274     virtual void
00275     replacePendingAttribute(
00276             const XalanDOMChar*     theName,
00277             const XalanDOMChar*     theNewType,
00278             const XalanDOMChar*     theNewValue) = 0;
00279 
00285     virtual FormatterListener*
00286     getFormatterListener() const = 0;
00287 
00293     virtual void
00294     setFormatterListener(FormatterListener*     flistener) = 0;
00295 
00296     virtual void
00297     pushOutputContext(FormatterListener*    flistener = 0) = 0;
00298 
00299     virtual void
00300     popOutputContext() = 0;
00301 
00302     class OutputContextPushPop
00303     {
00304     public:
00305 
00312         OutputContextPushPop(
00313             StylesheetExecutionContext&     theExecutionContext,
00314             FormatterListener*              theNewListener = 0) :
00315             m_executionContext(theExecutionContext)
00316         {
00317             m_executionContext.pushOutputContext(theNewListener);
00318         }
00319 
00320         ~OutputContextPushPop()
00321         {
00322             m_executionContext.popOutputContext();
00323         }
00324 
00325     private:
00326 
00327         StylesheetExecutionContext&     m_executionContext;
00328     };
00329 
00336     virtual void
00337     addResultAttribute(
00338             const XalanDOMString&   aname,
00339             const XalanDOMString&   value) = 0;
00340 
00346     virtual void
00347     copyNamespaceAttributes(const XalanNode&    src) = 0;
00348 
00356     virtual const XalanDOMString*
00357     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const = 0;
00358 
00366     virtual const XalanDOMString*
00367     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const = 0;
00368 
00377     virtual bool
00378     isPendingResultPrefix(const XalanDOMString& thePrefix) = 0;
00379 
00385     virtual XalanDOMString
00386     getUniqueNamespaceValue() const = 0;
00387 
00393     virtual void
00394     getUniqueNamespaceValue(XalanDOMString&     theValue) const = 0;
00395 
00401     virtual int
00402     getIndent() const = 0;
00403 
00409     virtual void
00410     setIndent(int   indentAmount) = 0;
00411 
00412     // $$$ ToDo: Remove this one!!!!
00422     virtual const XObjectPtr
00423     executeXPath(
00424             const XalanDOMString&   str,
00425             XalanNode*              contextNode,
00426             const XalanElement&     resolver) = 0;
00427 
00436     virtual const XPath*
00437     createMatchPattern(
00438             const XalanDOMString&   str,
00439             const PrefixResolver&   resolver) = 0;
00440 
00446     virtual void
00447     returnXPath(const XPath*    xpath) = 0;
00448 
00449     // A helper class to automatically return an XPath instance.
00450     class XPathGuard
00451     {
00452     public:
00453 
00454         XPathGuard(
00455                 StylesheetExecutionContext&     context,
00456                 const XPath*                    xpath = 0) :
00457             m_context(context),
00458             m_xpath(xpath)
00459         {
00460         }
00461 
00462         ~XPathGuard()
00463         {
00464             if (m_xpath != 0)
00465             {
00466                 m_context.returnXPath(m_xpath);
00467             }
00468         }
00469 
00470         const XPath*
00471         get() const
00472         {
00473             return m_xpath;
00474         }
00475 
00476         const XPath*
00477         release()
00478         {
00479             const XPath* const  temp = m_xpath;
00480 
00481             m_xpath = 0;
00482 
00483             return temp;
00484         }
00485 
00486         void
00487         reset(const XPath*  xpath)
00488         {
00489             if (m_xpath != 0)
00490             {
00491                 m_context.returnXPath(m_xpath);
00492             }
00493 
00494             m_xpath = xpath;
00495         }
00496 
00497     private:
00498 
00499         StylesheetExecutionContext&     m_context;
00500 
00501         const XPath*                    m_xpath;
00502     };
00503 
00504 #if defined(XALAN_NO_NAMESPACES)
00505     typedef vector<TopLevelArg>         ParamVectorType;
00506 #else
00507     typedef std::vector<TopLevelArg>    ParamVectorType;
00508 #endif
00509 
00516     virtual void
00517     pushTopLevelVariables(const ParamVectorType&    topLevelParams) = 0;
00518 
00529     virtual const XObjectPtr
00530     createVariable(
00531             const ElemTemplateElement*  element,
00532             const XPath&                xpath,
00533             XalanNode*                  contextNode,
00534             const PrefixResolver&       resolver) = 0;
00535 
00545     virtual const XObjectPtr
00546     createVariable(
00547             const ElemTemplateElement*  element,
00548             const ElemTemplateElement&  templateChild,
00549             XalanNode*                  sourceNode) = 0;
00550 
00563     virtual void
00564     pushVariable(
00565             const XalanQName&           name,
00566             const ElemTemplateElement*  element,
00567             const XalanDOMString&       str,
00568             XalanNode*                  contextNode,
00569             const PrefixResolver&       resolver) = 0;
00570 
00582     virtual void
00583     pushVariable(
00584             const XalanQName&           name,
00585             const ElemTemplateElement*  element,
00586             const XPath&                xpath,
00587             XalanNode*                  contextNode,
00588             const PrefixResolver&       resolver) = 0;
00589 
00599     virtual void
00600     pushVariable(
00601             const XalanQName&           name,
00602             const ElemTemplateElement*  element,
00603             const ElemTemplateElement&  templateChild,
00604             XalanNode*                  sourceNode) = 0;
00605 
00614     virtual void
00615     pushVariable(
00616             const XalanQName&           name,
00617             const XObjectPtr            val,
00618             const ElemTemplateElement*  element) = 0;
00619 
00628     virtual void
00629     pushVariable(
00630             const XalanQName&           name,
00631             const ElemVariable*         var,
00632             const ElemTemplateElement*  element) = 0;
00633 
00638     virtual void
00639     pushContextMarker() = 0;
00640 
00644     virtual void
00645     popContextMarker() = 0;
00646 
00647     /*
00648      * A class to manage pushing and popping an element's stack
00649      * frame context.
00650      */
00651     class PushAndPopContextMarker
00652     {
00653     public:
00654 
00655         PushAndPopContextMarker(StylesheetExecutionContext&     executionContext) :
00656             m_executionContext(executionContext)
00657         {
00658             executionContext.pushContextMarker();
00659         }
00660 
00661         ~PushAndPopContextMarker()
00662         {
00663             m_executionContext.popContextMarker();
00664         }
00665 
00666     private:
00667 
00668         StylesheetExecutionContext&     m_executionContext;
00669     };
00670 
00674     virtual void
00675     resolveTopLevelParams() = 0;
00676 
00680     virtual void
00681     clearTopLevelParams() = 0;
00682 
00683     class ResolveAndClearTopLevelParams
00684     {
00685     public:
00686 
00687         ResolveAndClearTopLevelParams(StylesheetExecutionContext&   executionContext) :
00688             m_executionContext(executionContext)
00689         {
00690             m_executionContext.resolveTopLevelParams();
00691         }
00692 
00693         ~ResolveAndClearTopLevelParams()
00694         {
00695             m_executionContext.clearTopLevelParams();
00696         }
00697 
00698     private:
00699 
00700         StylesheetExecutionContext&     m_executionContext;
00701     };
00702 
00711     virtual void
00712     pushParams(
00713             const ElemTemplateElement&  xslCallTemplateElement,
00714             XalanNode*                  sourceNode,
00715             const ElemTemplateElement*  targetTemplate) = 0;
00716 
00724     virtual const XObjectPtr
00725     getParamVariable(const XalanQName&  theName) = 0;
00726 
00732     virtual void
00733     pushElementFrame(const ElemTemplateElement*     elem) = 0;
00734 
00740     virtual void
00741     popElementFrame(const ElemTemplateElement*  elem) = 0;
00742 
00743     /*
00744      * A class to manage pushing and popping an element's stack
00745      * frame context.
00746      */
00747     class PushAndPopElementFrame
00748     {
00749     public:
00750 
00751         PushAndPopElementFrame(
00752             StylesheetExecutionContext&     executionContext,
00753             const ElemTemplateElement*      element) :
00754             m_executionContext(executionContext),
00755             m_element(element)
00756         {
00757             executionContext.pushElementFrame(element);
00758         }
00759 
00760         ~PushAndPopElementFrame()
00761         {
00762             m_executionContext.popElementFrame(m_element);
00763         }
00764 
00765     private:
00766 
00767         StylesheetExecutionContext&     m_executionContext;
00768 
00769         const ElemTemplateElement*      m_element;
00770     };
00771 
00777     virtual int
00778     getGlobalStackFrameIndex() const = 0;
00779 
00786     virtual int
00787     getCurrentStackFrameIndex() const = 0;
00788 
00795     virtual void
00796     setCurrentStackFrameIndex(int   currentStackFrameIndex = -1) = 0;
00797 
00798     /*
00799      * A class to manage the state of the variable stacks frame index.
00800      */
00801     class SetAndRestoreCurrentStackFrameIndex
00802     {
00803     public:
00804 
00805         SetAndRestoreCurrentStackFrameIndex(
00806             StylesheetExecutionContext&     executionContext,
00807             int                             newIndex) :
00808             m_executionContext(executionContext),
00809             m_savedIndex(executionContext.getCurrentStackFrameIndex())
00810         {
00811             executionContext.setCurrentStackFrameIndex(newIndex);
00812         }
00813 
00814         ~SetAndRestoreCurrentStackFrameIndex()
00815         {
00816             m_executionContext.setCurrentStackFrameIndex(m_savedIndex);
00817         }
00818 
00819         int
00820         getStackFrameIndex() const
00821         {
00822             return m_savedIndex;
00823         }
00824 
00825     private:
00826 
00827         StylesheetExecutionContext&     m_executionContext;
00828 
00829         const int                       m_savedIndex;
00830     };
00831 
00832     /*
00833      * A class to manage stack state during execution.
00834      */
00835     class ParamsPushPop
00836     {
00837     public:
00838 
00839         ParamsPushPop(
00840             StylesheetExecutionContext&     executionContext,
00841             const ElemTemplateElement&      xslCallTemplateElement,
00842             XalanNode*                      sourceNode,
00843             const ElemTemplateElement*      targetTemplate);
00844 
00845         ~ParamsPushPop();
00846 
00847         int
00848         getStackFrameIndex() const
00849         {
00850             return m_savedStackFrameIndex;
00851         }
00852 
00853     private:
00854 
00855         StylesheetExecutionContext&     m_executionContext;
00856     
00857         const int                       m_savedStackFrameIndex;
00858     };
00859 
00869     virtual void
00870     startDocument() = 0;
00871 
00883     virtual void
00884     endDocument() = 0;
00885 
00891     virtual void
00892     startElement(const XalanDOMChar*    name) = 0;
00893 
00899     virtual void
00900     endElement(const XalanDOMChar*  name) = 0;
00901 
00909     virtual void
00910     characters(
00911             const XalanDOMChar*         ch,
00912             XalanDOMString::size_type   start,
00913             XalanDOMString::size_type   length) = 0;
00914 
00924     virtual void
00925     charactersRaw(
00926             const XalanDOMChar*         ch,
00927             XalanDOMString::size_type   start,
00928             XalanDOMString::size_type   length) = 0;
00929 
00935     virtual void
00936     comment(const XalanDOMChar*     data) = 0;
00937 
00944     virtual void
00945     processingInstruction(
00946             const XalanDOMChar*     target,
00947             const XalanDOMChar*     data) = 0;
00948 
00952     virtual void
00953     flushPending() = 0;
00954 
00965     virtual void
00966     cloneToResultTree(
00967             XalanNode&                  node,
00968             XalanNode::NodeType         nodeType,
00969             bool                        isLiteral,
00970             bool                        overrideStrip,
00971             bool                        shouldCloneAttributes,
00972             const ElemTemplateElement*  styleNode = 0) = 0;
00973 
00981     virtual const XObjectPtr
00982     createXResultTreeFrag(
00983             const ElemTemplateElement&  templateChild,
00984             XalanNode*                  sourceNode) = 0;
00985 
00992     virtual void
00993     outputToResultTree(const XObject&   xobj) = 0;
00994 
01001     virtual void
01002     outputResultTreeFragment(const XObject&     theTree) = 0;
01003 
01009     virtual const XalanDOMString&
01010     getXSLNameSpaceURL() const = 0;
01011 
01017     virtual const XalanDOMString&
01018     getXalanXSLNameSpaceURL() const = 0;
01019 
01025     virtual bool
01026     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const = 0;
01027 
01033     virtual void
01034     pushOnElementRecursionStack(const ElemTemplateElement*  theElement) = 0;
01035 
01041     virtual const ElemTemplateElement*
01042     popElementRecursionStack() = 0;
01043 
01047     class ElementRecursionStackPusher
01048     {
01049     public:
01050 
01057         ElementRecursionStackPusher(
01058                     StylesheetExecutionContext&     executionContext,
01059                     const ElemTemplateElement*      element) :
01060             m_executionContext(executionContext)
01061         {
01062             m_executionContext.pushOnElementRecursionStack(element);
01063         }
01064 
01065         ~ElementRecursionStackPusher()
01066         {
01067             m_executionContext.popElementRecursionStack();
01068         }
01069 
01070     private:
01071 
01072         StylesheetExecutionContext&         m_executionContext;
01073     };
01074 
01075 
01085     virtual bool
01086     returnXResultTreeFrag(XResultTreeFrag*  theXResultTreeFrag) = 0;
01087 
01088 
01089     enum eDummy
01090     {
01091         eDefaultXMLIndentAmount = 0,
01092         eDefaultHTMLIndentAmount = 0
01093     };
01094 
01115     virtual FormatterToXML*
01116     createFormatterToXML(
01117             Writer&                 writer,
01118             const XalanDOMString&   version = XalanDOMString(),
01119             bool                    doIndent = false,
01120             int                     indent = eDefaultXMLIndentAmount,
01121             const XalanDOMString&   encoding = XalanDOMString(),
01122             const XalanDOMString&   mediaType = XalanDOMString(),
01123             const XalanDOMString&   doctypeSystem = XalanDOMString(),
01124             const XalanDOMString&   doctypePublic = XalanDOMString(),
01125             bool                    xmlDecl = true,
01126             const XalanDOMString&   standalone = XalanDOMString()) = 0;
01127 
01148     virtual FormatterToHTML*
01149     createFormatterToHTML(
01150             Writer&                 writer,
01151             const XalanDOMString&   encoding = XalanDOMString(),
01152             const XalanDOMString&   mediaType = XalanDOMString(),
01153             const XalanDOMString&   doctypeSystem = XalanDOMString(),
01154             const XalanDOMString&   doctypePublic = XalanDOMString(),
01155             bool                    doIndent = true,
01156             int                     indent = eDefaultHTMLIndentAmount,
01157             const XalanDOMString&   version = XalanDOMString(),
01158             const XalanDOMString&   standalone = XalanDOMString(),
01159             bool                    xmlDecl = false) = 0;
01160 
01169     virtual FormatterToDOM*
01170     createFormatterToDOM(
01171             XalanDocument*          doc,
01172             XalanDocumentFragment*  docFrag,
01173             XalanElement*           currentElement) = 0;
01174 
01183     virtual FormatterToDOM*
01184     createFormatterToDOM(
01185             XalanDocument*  doc,
01186             XalanElement*   elem) = 0;
01187 
01194     virtual FormatterToText*
01195     createFormatterToText(
01196             Writer&                 writer,
01197             const XalanDOMString&   encoding) = 0;
01198 
01204     virtual FormatterToText*
01205     borrowFormatterToText() = 0;
01206 
01213     virtual bool
01214     returnFormatterToText(FormatterToText*  theFormatter) = 0;
01215 
01216     class BorrowReturnFormatterToText
01217     {
01218     public:
01219 
01220         BorrowReturnFormatterToText(
01221                 StylesheetExecutionContext&     executionContext,
01222                 Writer&                         writer,
01223                 bool                            normalizeLinefeed = true,
01224                 bool                            handleIgnorableWhitespace = true);
01225 
01226         ~BorrowReturnFormatterToText()
01227         {
01228             assert(m_formatter != 0);
01229 
01230             m_executionContext.returnFormatterToText(m_formatter);
01231         }
01232 
01233         FormatterToText&
01234         operator*() const
01235         {
01236             assert(m_formatter != 0);
01237 
01238             return *m_formatter;
01239         }
01240 
01241         FormatterToText*
01242         get() const
01243         {
01244             assert(m_formatter != 0);
01245 
01246             return m_formatter;
01247         }
01248 
01249         FormatterToText*
01250         operator->() const
01251         {
01252             return get();
01253         }
01254 
01255     private:
01256 
01257         StylesheetExecutionContext&     m_executionContext;
01258 
01259         FormatterToText*                m_formatter;
01260     };
01261 
01262 
01268     virtual NodeSorter*
01269     borrowNodeSorter() = 0;
01270 
01277     virtual bool
01278     returnNodeSorter(NodeSorter*    theSorter) = 0;
01279 
01280     class BorrowReturnNodeSorter
01281     {
01282     public:
01283 
01284         BorrowReturnNodeSorter(StylesheetExecutionContext&  executionContext) :
01285             m_executionContext(executionContext),
01286             m_sorter(executionContext.borrowNodeSorter())
01287         {
01288             assert(m_sorter != 0);
01289         }
01290 
01291         ~BorrowReturnNodeSorter()
01292         {
01293             assert(m_sorter != 0);
01294 
01295             m_executionContext.returnNodeSorter(m_sorter);
01296         }
01297 
01298         NodeSorter&
01299         operator*() const
01300         {
01301             assert(m_sorter != 0);
01302 
01303             return *m_sorter;
01304         }
01305 
01306         NodeSorter*
01307         get() const
01308         {
01309             assert(m_sorter != 0);
01310 
01311             return m_sorter;
01312         }
01313 
01314         NodeSorter*
01315         operator->() const
01316         {
01317             return get();
01318         }
01319 
01320     private:
01321 
01322         StylesheetExecutionContext&     m_executionContext;
01323 
01324         NodeSorter*                     m_sorter;
01325     };
01326 
01327 
01328     typedef XalanAutoPtr<XalanNumberFormat>     XalanNumberFormatAutoPtr;
01329 
01336     virtual XalanNumberFormatAutoPtr
01337     createXalanNumberFormat() = 0;
01338 
01339 
01340     // Trace interface...
01341 
01347     virtual size_type
01348     getTraceListeners() const = 0;
01349 
01355     virtual void
01356     fireGenerateEvent(const GenerateEvent&  ge) = 0;
01357 
01363     virtual void
01364     fireTraceEvent(const TracerEvent&   te) = 0;
01365 
01371     virtual void
01372     fireSelectEvent(const SelectionEvent&   se) = 0;
01373 
01379     virtual bool
01380     getTraceSelects() const = 0;
01381 
01388     virtual void
01389     traceSelect(
01390             const XalanElement&     theTemplate,
01391             const NodeRefListBase&  nl) const = 0;
01392 
01401     virtual int
01402     collationCompare(
01403             const XalanDOMString&   theLHS,
01404             const XalanDOMString&   theRHS) = 0;
01405 
01415     virtual int
01416     collationCompare(
01417             const XalanDOMString&   theLHS,
01418             const XalanDOMString&   theRHS,
01419             const XalanDOMString&   theLocale) = 0;
01420 
01429     virtual int
01430     collationCompare(
01431             const XalanDOMChar*     theLHS,
01432             const XalanDOMChar*     theRHS) = 0;
01433 
01443     virtual int
01444     collationCompare(
01445             const XalanDOMChar*     theLHS,
01446             const XalanDOMChar*     theRHS,
01447             const XalanDOMChar*     theLocale) = 0;
01448 
01455     virtual bool
01456     getInConstruction(const KeyDeclaration&     keyDeclaration) const = 0;
01457 
01463     virtual void
01464     beginConstruction(const KeyDeclaration& keyDeclaration) = 0; 
01465 
01471     virtual void
01472     endConstruction(const KeyDeclaration& keyDeclaration) = 0;
01473 
01480     virtual PrintWriter*
01481     createPrintWriter(XalanOutputStream*        theTextOutputStream) = 0;
01482 
01491     virtual PrintWriter*
01492     createPrintWriter(
01493             const XalanDOMString&       theFileName,
01494             const XalanDOMString&       theEncoding) = 0;
01495 
01502     virtual PrintWriter*
01503 #if defined(XALAN_NO_NAMESPACES)
01504     createPrintWriter(ostream&          theStream) = 0;
01505 #else
01506     createPrintWriter(std::ostream&     theStream) = 0;
01507 #endif
01508 
01515     virtual CountersTable&
01516     getCountersTable() = 0;
01517 
01523     virtual void
01524     characters(const XalanNode&     node) = 0;
01525 
01531     virtual void
01532     characters(const XObjectPtr&    xobject) = 0;
01533 
01540     virtual void
01541     charactersRaw(const XalanNode&  node) = 0;
01542 
01548     virtual void
01549     charactersRaw(const XObjectPtr&     xobject) = 0;
01550 
01551 
01552     // These interfaces are inherited from XPathExecutionContext...
01553 
01554     virtual void
01555     reset() = 0;
01556 
01557     virtual XalanNode*
01558     getCurrentNode() const = 0;
01559 
01560     virtual void
01561     setCurrentNode(XalanNode*   theCurrentNode) = 0;
01562 
01563     virtual XObjectFactory&
01564     getXObjectFactory() const = 0;
01565 
01566     virtual XObjectPtr
01567     createNodeSet(XalanNode&    theNode) = 0;
01568 
01569     virtual bool
01570     isNodeAfter(
01571             const XalanNode&    node1,
01572             const XalanNode&    node2) const = 0;
01573 
01574     virtual const NodeRefListBase&
01575     getContextNodeList() const = 0;
01576 
01577     virtual void    
01578     setContextNodeList(const NodeRefListBase&   theList) = 0;
01579 
01580     virtual size_type
01581     getContextNodeListLength() const = 0;
01582 
01583     virtual size_type
01584     getContextNodeListPosition(const XalanNode&     contextNode) const = 0;
01585 
01586     virtual bool
01587     elementAvailable(
01588             const XalanDOMString&   theNamespace, 
01589             const XalanDOMString&   elementName) const = 0;
01590 
01591     virtual bool
01592     functionAvailable(
01593             const XalanDOMString&   theNamespace, 
01594             const XalanDOMString&   functionName) const = 0;
01595 
01596     virtual const XObjectPtr
01597     extFunction(
01598             const XalanDOMString&           theNamespace,
01599             const XalanDOMString&           functionName,
01600             XalanNode*                      context,
01601             const XObjectArgVectorType&     argVec,
01602             const Locator*                  locator) = 0;
01603 
01604     virtual XalanDocument*
01605     parseXML(
01606             const XalanDOMString&   urlString,
01607             const XalanDOMString&   base) const = 0;
01608 
01609     virtual MutableNodeRefList*
01610     borrowMutableNodeRefList() = 0;
01611 
01612     virtual bool
01613     returnMutableNodeRefList(MutableNodeRefList*    theList) = 0;
01614 
01615     virtual MutableNodeRefList*
01616     createMutableNodeRefList() const = 0;
01617 
01618     virtual XalanDOMString&
01619     getCachedString() = 0;
01620 
01621     virtual bool
01622     releaseCachedString(XalanDOMString&     theString) = 0;
01623 
01624     virtual void
01625     getNodeSetByKey(
01626             XalanNode*              doc,
01627             const XalanDOMString&   name,
01628             const XalanDOMString&   ref,
01629             const PrefixResolver&   resolver,
01630             MutableNodeRefList&     nodelist) = 0;
01631 
01632     virtual const XObjectPtr
01633     getVariable(
01634             const XalanQName&   name,
01635             const Locator*      locator = 0) = 0;
01636 
01637     virtual const PrefixResolver*
01638     getPrefixResolver() const = 0;
01639 
01640     virtual void
01641     setPrefixResolver(const PrefixResolver*     thePrefixResolver) = 0;
01642 
01643     virtual const XalanDOMString*
01644     getNamespaceForPrefix(const XalanDOMString&     prefix) const = 0;
01645 
01646     virtual XalanDOMString
01647     findURIFromDoc(const XalanDocument*     owner) const = 0;
01648 
01649     virtual const XalanDOMString&
01650     getUnparsedEntityURI(
01651             const XalanDOMString&   theName,
01652             const XalanDocument&    theDocument) const = 0;
01653 
01654     virtual bool
01655     shouldStripSourceNode(const XalanNode&  node) = 0;
01656 
01657     virtual bool
01658     getThrowFoundIndex() const = 0;
01659 
01660     virtual void
01661     setThrowFoundIndex(bool     fThrow) = 0;
01662 
01663     virtual XalanDocument*
01664     getSourceDocument(const XalanDOMString&     theURI) const = 0;
01665 
01666     virtual void
01667     setSourceDocument(
01668             const XalanDOMString&   theURI,
01669             XalanDocument*          theDocument) = 0;
01670 
01671 
01672     virtual const XalanDecimalFormatSymbols*
01673     getDecimalFormatSymbols(const XalanQName&   qname) = 0;
01674 
01675     // These interfaces are inherited from ExecutionContext...
01676 
01677     virtual void
01678     error(
01679             const XalanDOMString&   msg,
01680             const XalanNode*        sourceNode = 0,
01681             const XalanNode*        styleNode = 0) const = 0;
01682 
01683     virtual void
01684     error(
01685             const XalanDOMString&   msg,
01686             const XalanNode*        sourceNode,
01687             const Locator*          locator) const = 0;
01688 
01689     virtual void
01690     error(
01691             const char*         msg,
01692             const XalanNode*    sourceNode = 0,
01693             const XalanNode*    styleNode = 0) const = 0;
01694 
01695     virtual void
01696     error(
01697             const char*         msg,
01698             const XalanNode*    sourceNode,
01699             const Locator*      locator) const = 0;
01700 
01701     virtual void
01702     warn(
01703             const XalanDOMString&   msg,
01704             const XalanNode*        sourceNode = 0,
01705             const XalanNode*        styleNode = 0) const = 0;
01706 
01707     virtual void
01708     warn(
01709             const XalanDOMString&   msg,
01710             const XalanNode*        sourceNode,
01711             const Locator*          locator) const = 0;
01712 
01713     virtual void
01714     warn(
01715             const char*         msg,
01716             const XalanNode*    sourceNode = 0,
01717             const XalanNode*    styleNode = 0) const = 0;
01718 
01719     virtual void
01720     warn(
01721             const char*         msg,
01722             const XalanNode*    sourceNode,
01723             const Locator*      locator) const = 0;
01724 
01725     virtual void
01726     message(
01727             const XalanDOMString&   msg,
01728             const XalanNode*        sourceNode = 0,
01729             const XalanNode*        styleNode = 0) const = 0;
01730 
01731     virtual void
01732     message(
01733             const XalanDOMString&   msg,
01734             const XalanNode*    sourceNode,
01735             const Locator*      locator) const = 0;
01736 
01737     virtual void
01738     message(
01739             const char*         msg,
01740             const XalanNode*    sourceNode = 0,
01741             const XalanNode*    styleNode = 0) const = 0;
01742 
01743     virtual void
01744     message(
01745             const char*         msg,
01746             const XalanNode*    sourceNode,
01747             const Locator*      locator) const = 0;
01748 };
01749 
01750 
01751 
01752 #endif  // STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680

Interpreting class diagrams

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

Xalan-C++ XSLT Processor Version 1.3
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.