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  

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_STREAM_HEADERS)
00070 #include <iostream.h>
00071 #else
00072 #if defined(XALAN_NO_IOSFWD)
00073 #include <ostream>
00074 #else
00075 #include <iosfwd>
00076 #endif
00077 #endif
00078 
00079 
00080 
00081 #include <memory>
00082 
00083 
00084 
00085 // Base class header file...
00086 #include <XPath/XPathExecutionContext.hpp>
00087 
00088 
00089 
00090 #include <XalanDOM/XalanDOMString.hpp>
00091 
00092 
00093 
00094 // Base class header file...
00095 #include <PlatformSupport/ExecutionContext.hpp>
00096 
00097 
00098 
00099 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
00100 #include <PlatformSupport/XalanNumberFormat.hpp>
00101 #endif
00102 
00103 
00104 
00105 #include <Include/XalanAutoPtr.hpp>
00106 
00107 
00108 
00109 #include <PlatformSupport/AttributeListImpl.hpp>
00110 
00111 
00112 
00113 #include <XSLT/KeyTable.hpp>
00114 #include <XSLT/TopLevelArg.hpp>
00115 
00116 
00117 
00118 class CountersTable;
00119 class ElemTemplateElement;
00120 class ElemVariable;
00121 class FormatterListener;
00122 class FormatterToDOM;
00123 class FormatterToHTML;
00124 class FormatterToText;
00125 class FormatterToXML;
00126 class GenerateEvent;
00127 class KeyTable;
00128 class PrefixResolver;
00129 class NodeRefListBase;
00130 class NodeSorter;
00131 class PrintWriter;
00132 class XalanQName;
00133 class SelectionEvent;
00134 class Stylesheet;
00135 class StylesheetRoot;
00136 class XalanOutputStream;
00137 class TracerEvent;
00138 class Writer;
00139 class XalanDocument;
00140 class XalanDocumentFragment;
00141 class XalanElement;
00142 class XalanNode;
00143 class XalanNumberFormat;
00144 class XPath;
00145 class XObject;
00146 class XObjectPtr;
00147 
00148 
00149 
00150 //
00151 // An abstract class which provides support for executing stylesheets.
00152 //
00153 class XALAN_XSLT_EXPORT StylesheetExecutionContext : public XPathExecutionContext
00154 {
00155 public:
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 
00404     // $$$ ToDo: Remove this one!!!!
00414     virtual const XObjectPtr
00415     executeXPath(
00416             const XalanDOMString&   str,
00417             XalanNode*              contextNode,
00418             const XalanElement&     resolver) = 0;
00419 
00428     virtual const XPath*
00429     createMatchPattern(
00430             const XalanDOMString&   str,
00431             const PrefixResolver&   resolver) = 0;
00432 
00438     virtual void
00439     returnXPath(const XPath*    xpath) = 0;
00440 
00441     // A helper class to automatically return an XPath instance.
00442     class XPathGuard
00443     {
00444     public:
00445 
00446         XPathGuard(
00447                 StylesheetExecutionContext&     context,
00448                 const XPath*                    xpath = 0) :
00449             m_context(context),
00450             m_xpath(xpath)
00451         {
00452         }
00453 
00454         ~XPathGuard()
00455         {
00456             if (m_xpath != 0)
00457             {
00458                 m_context.returnXPath(m_xpath);
00459             }
00460         }
00461 
00462         const XPath*
00463         get() const
00464         {
00465             return m_xpath;
00466         }
00467 
00468         const XPath*
00469         release()
00470         {
00471             const XPath* const  temp = m_xpath;
00472 
00473             m_xpath = 0;
00474 
00475             return temp;
00476         }
00477 
00478         void
00479         reset(const XPath*  xpath)
00480         {
00481             if (m_xpath != 0)
00482             {
00483                 m_context.returnXPath(m_xpath);
00484             }
00485 
00486             m_xpath = xpath;
00487         }
00488 
00489     private:
00490 
00491         StylesheetExecutionContext&     m_context;
00492 
00493         const XPath*                    m_xpath;
00494     };
00495 
00496 #if defined(XALAN_NO_NAMESPACES)
00497     typedef vector<TopLevelArg>         ParamVectorType;
00498 #else
00499     typedef std::vector<TopLevelArg>    ParamVectorType;
00500 #endif
00501 
00508     virtual void
00509     pushTopLevelVariables(const ParamVectorType&    topLevelParams) = 0;
00510 
00521     virtual const XObjectPtr
00522     createVariable(
00523             const ElemTemplateElement*  element,
00524             const XPath&                xpath,
00525             XalanNode*                  contextNode,
00526             const PrefixResolver&       resolver) = 0;
00527 
00537     virtual const XObjectPtr
00538     createVariable(
00539             const ElemTemplateElement*  element,
00540             const ElemTemplateElement&  templateChild,
00541             XalanNode*                  sourceNode) = 0;
00542 
00555     virtual void
00556     pushVariable(
00557             const XalanQName&           name,
00558             const ElemTemplateElement*  element,
00559             const XalanDOMString&       str,
00560             XalanNode*                  contextNode,
00561             const PrefixResolver&       resolver) = 0;
00562 
00574     virtual void
00575     pushVariable(
00576             const XalanQName&           name,
00577             const ElemTemplateElement*  element,
00578             const XPath&                xpath,
00579             XalanNode*                  contextNode,
00580             const PrefixResolver&       resolver) = 0;
00581 
00591     virtual void
00592     pushVariable(
00593             const XalanQName&           name,
00594             const ElemTemplateElement*  element,
00595             const ElemTemplateElement&  templateChild,
00596             XalanNode*                  sourceNode) = 0;
00597 
00606     virtual void
00607     pushVariable(
00608             const XalanQName&           name,
00609             const XObjectPtr            val,
00610             const ElemTemplateElement*  element) = 0;
00611 
00620     virtual void
00621     pushVariable(
00622             const XalanQName&           name,
00623             const ElemVariable*         var,
00624             const ElemTemplateElement*  element) = 0;
00625 
00630     virtual void
00631     pushContextMarker() = 0;
00632 
00636     virtual void
00637     popContextMarker() = 0;
00638 
00639     /*
00640      * A class to manage pushing and popping an element's stack
00641      * frame context.
00642      */
00643     class PushAndPopContextMarker
00644     {
00645     public:
00646 
00647         PushAndPopContextMarker(StylesheetExecutionContext&     executionContext) :
00648             m_executionContext(executionContext)
00649         {
00650             executionContext.pushContextMarker();
00651         }
00652 
00653         ~PushAndPopContextMarker()
00654         {
00655             m_executionContext.popContextMarker();
00656         }
00657 
00658     private:
00659 
00660         StylesheetExecutionContext&     m_executionContext;
00661     };
00662 
00666     virtual void
00667     resolveTopLevelParams() = 0;
00668 
00672     virtual void
00673     clearTopLevelParams() = 0;
00674 
00675     class ResolveAndClearTopLevelParams
00676     {
00677     public:
00678 
00679         ResolveAndClearTopLevelParams(StylesheetExecutionContext&   executionContext) :
00680             m_executionContext(executionContext)
00681         {
00682             m_executionContext.resolveTopLevelParams();
00683         }
00684 
00685         ~ResolveAndClearTopLevelParams()
00686         {
00687             m_executionContext.clearTopLevelParams();
00688         }
00689 
00690     private:
00691 
00692         StylesheetExecutionContext&     m_executionContext;
00693     };
00694 
00703     virtual void
00704     pushParams(
00705             const ElemTemplateElement&  xslCallTemplateElement,
00706             XalanNode*                  sourceNode,
00707             const ElemTemplateElement*  targetTemplate) = 0;
00708 
00716     virtual const XObjectPtr
00717     getParamVariable(const XalanQName&  theName) = 0;
00718 
00724     virtual void
00725     pushElementFrame(const ElemTemplateElement*     elem) = 0;
00726 
00732     virtual void
00733     popElementFrame(const ElemTemplateElement*  elem) = 0;
00734 
00735     /*
00736      * A class to manage pushing and popping an element's stack
00737      * frame context.
00738      */
00739     class PushAndPopElementFrame
00740     {
00741     public:
00742 
00743         PushAndPopElementFrame(
00744             StylesheetExecutionContext&     executionContext,
00745             const ElemTemplateElement*      element) :
00746             m_executionContext(executionContext),
00747             m_element(element)
00748         {
00749             executionContext.pushElementFrame(element);
00750         }
00751 
00752         ~PushAndPopElementFrame()
00753         {
00754             m_executionContext.popElementFrame(m_element);
00755         }
00756 
00757     private:
00758 
00759         StylesheetExecutionContext&     m_executionContext;
00760 
00761         const ElemTemplateElement*      m_element;
00762     };
00763 
00769     virtual int
00770     getGlobalStackFrameIndex() const = 0;
00771 
00778     virtual int
00779     getCurrentStackFrameIndex() const = 0;
00780 
00787     virtual void
00788     setCurrentStackFrameIndex(int   currentStackFrameIndex = -1) = 0;
00789 
00790     /*
00791      * A class to manage the state of the variable stacks frame index.
00792      */
00793     class SetAndRestoreCurrentStackFrameIndex
00794     {
00795     public:
00796 
00797         SetAndRestoreCurrentStackFrameIndex(
00798             StylesheetExecutionContext&     executionContext,
00799             int                             newIndex) :
00800             m_executionContext(executionContext),
00801             m_savedIndex(executionContext.getCurrentStackFrameIndex())
00802         {
00803             executionContext.setCurrentStackFrameIndex(newIndex);
00804         }
00805 
00806         ~SetAndRestoreCurrentStackFrameIndex()
00807         {
00808             m_executionContext.setCurrentStackFrameIndex(m_savedIndex);
00809         }
00810 
00811         int
00812         getStackFrameIndex() const
00813         {
00814             return m_savedIndex;
00815         }
00816 
00817     private:
00818 
00819         StylesheetExecutionContext&     m_executionContext;
00820 
00821         const int                       m_savedIndex;
00822     };
00823 
00824     /*
00825      * A class to manage stack state during execution.
00826      */
00827     class ParamsPushPop
00828     {
00829     public:
00830 
00831         ParamsPushPop(
00832             StylesheetExecutionContext&     executionContext,
00833             const ElemTemplateElement&      xslCallTemplateElement,
00834             XalanNode*                      sourceNode,
00835             const ElemTemplateElement*      targetTemplate);
00836 
00837         ~ParamsPushPop();
00838 
00839         int
00840         getStackFrameIndex() const
00841         {
00842             return m_savedStackFrameIndex;
00843         }
00844 
00845     private:
00846 
00847         StylesheetExecutionContext&     m_executionContext;
00848     
00849         const int                       m_savedStackFrameIndex;
00850     };
00851 
00861     virtual void
00862     startDocument() = 0;
00863 
00875     virtual void
00876     endDocument() = 0;
00877 
00894     virtual void
00895     startElement(const XalanDOMChar*    name) = 0;
00896 
00911     virtual void
00912     endElement(const XalanDOMChar*  name) = 0;
00913 
00936     virtual void
00937     characters(
00938             const XalanDOMChar*     ch,
00939             unsigned int            start,
00940             unsigned int            length) = 0;
00941 
00952     virtual void
00953     charactersRaw(
00954             const XalanDOMChar*     ch,
00955             unsigned int            start,
00956             unsigned int            length) = 0;
00957 
00964     virtual void
00965     comment(const XalanDOMChar*     data) = 0;
00966 
00982     virtual void
00983     processingInstruction(
00984             const XalanDOMChar*     target,
00985             const XalanDOMChar*     data) = 0;
00986 
00990     virtual void
00991     flushPending() = 0;
00992 
01002     virtual void
01003     cloneToResultTree(
01004             XalanNode&              node,
01005             XalanNode::NodeType     nodeType,
01006             bool                    isLiteral,
01007             bool                    overrideStrip,
01008             bool                    shouldCloneAttributes) = 0;
01009 
01017     virtual const XObjectPtr
01018     createXResultTreeFrag(
01019             const ElemTemplateElement&  templateChild,
01020             XalanNode*                  sourceNode) = 0;
01021 
01028     virtual void
01029     outputToResultTree(const XObject&   xobj) = 0;
01030 
01037     virtual void
01038     outputResultTreeFragment(const XObject&     theTree) = 0;
01039 
01045     virtual const XalanDOMString&
01046     getXSLNameSpaceURL() const = 0;
01047 
01053     virtual const XalanDOMString&
01054     getXalanXSLNameSpaceURL() const = 0;
01055 
01061     virtual bool
01062     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const = 0;
01063 
01069     virtual void
01070     pushOnElementRecursionStack(const ElemTemplateElement*  theElement) = 0;
01071 
01077     virtual const ElemTemplateElement*
01078     popElementRecursionStack() = 0;
01079 
01083     class ElementRecursionStackPusher
01084     {
01085     public:
01086 
01093         ElementRecursionStackPusher(
01094                     StylesheetExecutionContext&     executionContext,
01095                     const ElemTemplateElement*      element) :
01096             m_executionContext(executionContext)
01097         {
01098             m_executionContext.pushOnElementRecursionStack(element);
01099         }
01100 
01101         ~ElementRecursionStackPusher()
01102         {
01103             m_executionContext.popElementRecursionStack();
01104         }
01105 
01106     private:
01107 
01108         StylesheetExecutionContext&         m_executionContext;
01109     };
01110 
01111 
01112     enum eDummy
01113     {
01114         eDefaultXMLIndentAmount = 0,
01115         eDefaultHTMLIndentAmount = 0
01116     };
01117 
01138     virtual FormatterToXML*
01139     createFormatterToXML(
01140             Writer&                 writer,
01141             const XalanDOMString&   version = XalanDOMString(),
01142             bool                    doIndent = false,
01143             int                     indent = eDefaultXMLIndentAmount,
01144             const XalanDOMString&   encoding = XalanDOMString(),
01145             const XalanDOMString&   mediaType = XalanDOMString(),
01146             const XalanDOMString&   doctypeSystem = XalanDOMString(),
01147             const XalanDOMString&   doctypePublic = XalanDOMString(),
01148             bool                    xmlDecl = true,
01149             const XalanDOMString&   standalone = XalanDOMString()) = 0;
01150 
01171     virtual FormatterToHTML*
01172     createFormatterToHTML(
01173             Writer&                 writer,
01174             const XalanDOMString&   encoding = XalanDOMString(),
01175             const XalanDOMString&   mediaType = XalanDOMString(),
01176             const XalanDOMString&   doctypeSystem = XalanDOMString(),
01177             const XalanDOMString&   doctypePublic = XalanDOMString(),
01178             bool                    doIndent = true,
01179             int                     indent = eDefaultHTMLIndentAmount,
01180             const XalanDOMString&   version = XalanDOMString(),
01181             const XalanDOMString&   standalone = XalanDOMString(),
01182             bool                    xmlDecl = false) = 0;
01183 
01192     virtual FormatterToDOM*
01193     createFormatterToDOM(
01194             XalanDocument*          doc,
01195             XalanDocumentFragment*  docFrag,
01196             XalanElement*           currentElement) = 0;
01197 
01206     virtual FormatterToDOM*
01207     createFormatterToDOM(
01208             XalanDocument*  doc,
01209             XalanElement*   elem) = 0;
01210 
01217     virtual FormatterToText*
01218     createFormatterToText(
01219             Writer&                 writer,
01220             const XalanDOMString&   encoding) = 0;
01221 
01227     virtual FormatterToText*
01228     borrowFormatterToText() = 0;
01229 
01236     virtual bool
01237     returnFormatterToText(FormatterToText*  theFormatter) = 0;
01238 
01239     class BorrowReturnFormatterToText
01240     {
01241     public:
01242 
01243         BorrowReturnFormatterToText(
01244                 StylesheetExecutionContext&     executionContext,
01245                 Writer&                         writer,
01246                 bool                            normalizeLinefeed = true,
01247                 bool                            handleIgnorableWhitespace = true);
01248 
01249         ~BorrowReturnFormatterToText()
01250         {
01251             assert(m_formatter != 0);
01252 
01253             m_executionContext.returnFormatterToText(m_formatter);
01254         }
01255 
01256         FormatterToText&
01257         operator*() const
01258         {
01259             assert(m_formatter != 0);
01260 
01261             return *m_formatter;
01262         }
01263 
01264         FormatterToText*
01265         get() const
01266         {
01267             assert(m_formatter != 0);
01268 
01269             return m_formatter;
01270         }
01271 
01272         FormatterToText*
01273         operator->() const
01274         {
01275             return get();
01276         }
01277 
01278     private:
01279 
01280         StylesheetExecutionContext&     m_executionContext;
01281 
01282         FormatterToText*                m_formatter;
01283     };
01284 
01285 
01291     virtual NodeSorter*
01292     borrowNodeSorter() = 0;
01293 
01300     virtual bool
01301     returnNodeSorter(NodeSorter*    theSorter) = 0;
01302 
01303     class BorrowReturnNodeSorter
01304     {
01305     public:
01306 
01307         BorrowReturnNodeSorter(StylesheetExecutionContext&  executionContext) :
01308             m_executionContext(executionContext),
01309             m_sorter(executionContext.borrowNodeSorter())
01310         {
01311             assert(m_sorter != 0);
01312         }
01313 
01314         ~BorrowReturnNodeSorter()
01315         {
01316             assert(m_sorter != 0);
01317 
01318             m_executionContext.returnNodeSorter(m_sorter);
01319         }
01320 
01321         NodeSorter&
01322         operator*() const
01323         {
01324             assert(m_sorter != 0);
01325 
01326             return *m_sorter;
01327         }
01328 
01329         NodeSorter*
01330         get() const
01331         {
01332             assert(m_sorter != 0);
01333 
01334             return m_sorter;
01335         }
01336 
01337         NodeSorter*
01338         operator->() const
01339         {
01340             return get();
01341         }
01342 
01343     private:
01344 
01345         StylesheetExecutionContext&     m_executionContext;
01346 
01347         NodeSorter*                     m_sorter;
01348     };
01349 
01350 
01351     typedef XalanAutoPtr<XalanNumberFormat>     XalanNumberFormatAutoPtr;
01352 
01359     virtual XalanNumberFormatAutoPtr
01360     createXalanNumberFormat() = 0;
01361 
01362 
01363     // Trace interface...
01364 
01370     virtual unsigned long
01371     getTraceListeners() const = 0;
01372 
01378     virtual void
01379     fireGenerateEvent(const GenerateEvent&  ge) = 0;
01380 
01386     virtual void
01387     fireTraceEvent(const TracerEvent&   te) = 0;
01388 
01394     virtual void
01395     fireSelectEvent(const SelectionEvent&   se) = 0;
01396 
01402     virtual bool
01403     getTraceSelects() const = 0;
01404 
01411     virtual void
01412     traceSelect(
01413             const XalanElement&     theTemplate,
01414             const NodeRefListBase&  nl) const = 0;
01415 
01424     virtual int
01425     collationCompare(
01426             const XalanDOMString&   theLHS,
01427             const XalanDOMString&   theRHS) = 0;
01428 
01438     virtual int
01439     collationCompare(
01440             const XalanDOMString&   theLHS,
01441             const XalanDOMString&   theRHS,
01442             const XalanDOMString&   theLocale) = 0;
01443 
01452     virtual int
01453     collationCompare(
01454             const XalanDOMChar*     theLHS,
01455             const XalanDOMChar*     theRHS) = 0;
01456 
01466     virtual int
01467     collationCompare(
01468             const XalanDOMChar*     theLHS,
01469             const XalanDOMChar*     theRHS,
01470             const XalanDOMChar*     theLocale) = 0;
01471 
01478     virtual bool
01479     getInConstruction(const KeyDeclaration&     keyDeclaration) const = 0;
01480 
01486     virtual void
01487     beginConstruction(const KeyDeclaration& keyDeclaration) = 0; 
01488     
01494     virtual void
01495     endConstruction(const KeyDeclaration& keyDeclaration) = 0;
01496 
01503     virtual PrintWriter*
01504     createPrintWriter(XalanOutputStream*        theTextOutputStream) = 0;
01505 
01514     virtual PrintWriter*
01515     createPrintWriter(
01516             const XalanDOMString&       theFileName,
01517             const XalanDOMString&       theEncoding) = 0;
01518 
01525     virtual PrintWriter*
01526 #if defined(XALAN_NO_NAMESPACES)
01527     createPrintWriter(ostream&          theStream) = 0;
01528 #else
01529     createPrintWriter(std::ostream&     theStream) = 0;
01530 #endif
01531 
01538     virtual CountersTable&
01539     getCountersTable() = 0;
01540 
01546     virtual void
01547     characters(const XalanNode&     node) = 0;
01548 
01554     virtual void
01555     characters(const XObjectPtr&    xobject) = 0;
01556 
01563     virtual void
01564     charactersRaw(const XalanNode&  node) = 0;
01565 
01571     virtual void
01572     charactersRaw(const XObjectPtr&     xobject) = 0;
01573 
01574 
01575     // These interfaces are inherited from XPathExecutionContext...
01576 
01577     virtual void
01578     reset() = 0;
01579 
01580     virtual XalanNode*
01581     getCurrentNode() const = 0;
01582 
01583     virtual void
01584     setCurrentNode(XalanNode*   theCurrentNode) = 0;
01585 
01586     virtual XObjectFactory&
01587     getXObjectFactory() const = 0;
01588 
01589     virtual XObjectPtr
01590     createNodeSet(XalanNode&    theNode) = 0;
01591 
01592     virtual bool
01593     isNodeAfter(
01594             const XalanNode&    node1,
01595             const XalanNode&    node2) const = 0;
01596 
01597     virtual const NodeRefListBase&
01598     getContextNodeList() const = 0;
01599 
01600     virtual void    
01601     setContextNodeList(const NodeRefListBase&   theList) = 0;
01602 
01603     virtual unsigned int
01604     getContextNodeListLength() const = 0;
01605 
01606     virtual unsigned int
01607     getContextNodeListPosition(const XalanNode&     contextNode) const = 0;
01608 
01609     virtual bool
01610     elementAvailable(
01611             const XalanDOMString&   theNamespace, 
01612             const XalanDOMString&   elementName) const = 0;
01613 
01614     virtual bool
01615     functionAvailable(
01616             const XalanDOMString&   theNamespace, 
01617             const XalanDOMString&   functionName) const = 0;
01618 
01619     virtual const XObjectPtr
01620     extFunction(
01621             const XalanDOMString&           theNamespace,
01622             const XalanDOMString&           functionName,
01623             XalanNode*                      context,
01624             const XObjectArgVectorType&     argVec) = 0;
01625 
01626     virtual XalanDocument*
01627     parseXML(
01628             const XalanDOMString&   urlString,
01629             const XalanDOMString&   base) const = 0;
01630 
01631     virtual MutableNodeRefList*
01632     borrowMutableNodeRefList() = 0;
01633 
01634     virtual bool
01635     returnMutableNodeRefList(MutableNodeRefList*    theList) = 0;
01636 
01637     virtual ResultTreeFragBase*
01638     borrowResultTreeFrag() = 0;
01639 
01640     virtual bool
01641     returnResultTreeFrag(ResultTreeFragBase*    theResultTreeFragBase) = 0;
01642 
01643     virtual MutableNodeRefList*
01644     createMutableNodeRefList() const = 0;
01645 
01646     virtual XalanDOMString&
01647     getCachedString() = 0;
01648 
01649     virtual bool
01650     releaseCachedString(XalanDOMString&     theString) = 0;
01651 
01652     virtual void
01653     getNodeSetByKey(
01654             XalanNode*              doc,
01655             const XalanDOMString&   name,
01656             const XalanDOMString&   ref,
01657             const PrefixResolver&   resolver,
01658             MutableNodeRefList&     nodelist) = 0;
01659 
01660     virtual const XObjectPtr
01661     getVariable(const XalanQName&   name) = 0;
01662 
01663     virtual const PrefixResolver*
01664     getPrefixResolver() const = 0;
01665 
01666     virtual void
01667     setPrefixResolver(const PrefixResolver*     thePrefixResolver) = 0;
01668 
01669     virtual const XalanDOMString*
01670     getNamespaceForPrefix(const XalanDOMString&     prefix) const = 0;
01671 
01672     virtual XalanDOMString
01673     findURIFromDoc(const XalanDocument*     owner) const = 0;
01674 
01675     virtual XalanDocument*
01676     getDOMFactory() const = 0;
01677 
01678     virtual const XalanDOMString&
01679     getUnparsedEntityURI(
01680             const XalanDOMString&   theName,
01681             const XalanDocument&    theDocument) const = 0;
01682 
01683     virtual bool
01684     shouldStripSourceNode(const XalanNode&  node) = 0;
01685 
01686     virtual bool
01687     getThrowFoundIndex() const = 0;
01688 
01689     virtual void
01690     setThrowFoundIndex(bool     fThrow) = 0;
01691 
01692     virtual XalanDocument*
01693     getSourceDocument(const XalanDOMString&     theURI) const = 0;
01694 
01695     virtual void
01696     setSourceDocument(
01697             const XalanDOMString&   theURI,
01698             XalanDocument*          theDocument) = 0;
01699 
01700 
01701     virtual const XalanDecimalFormatSymbols*
01702     getDecimalFormatSymbols(const XalanDOMString&   name) = 0;
01703 
01704     // These interfaces are inherited from ExecutionContext...
01705 
01706     virtual void
01707     error(
01708             const XalanDOMString&   msg,
01709             const XalanNode*        sourceNode = 0,
01710             const XalanNode*        styleNode = 0) const = 0;
01711 
01712     virtual void
01713     error(
01714             const XalanDOMString&   msg,
01715             const XalanNode*        sourceNode,
01716             const Locator*          locator) const = 0;
01717 
01718     virtual void
01719     error(
01720             const char*         msg,
01721             const XalanNode*    sourceNode = 0,
01722             const XalanNode*    styleNode = 0) const = 0;
01723 
01724     virtual void
01725     error(
01726             const char*         msg,
01727             const XalanNode*    sourceNode,
01728             const Locator*      locator) const = 0;
01729 
01730     virtual void
01731     warn(
01732             const XalanDOMString&   msg,
01733             const XalanNode*        sourceNode = 0,
01734             const XalanNode*        styleNode = 0) const = 0;
01735 
01736     virtual void
01737     warn(
01738             const XalanDOMString&   msg,
01739             const XalanNode*        sourceNode,
01740             const Locator*          locator) const = 0;
01741 
01742     virtual void
01743     warn(
01744             const char*         msg,
01745             const XalanNode*    sourceNode = 0,
01746             const XalanNode*    styleNode = 0) const = 0;
01747 
01748     virtual void
01749     warn(
01750             const char*         msg,
01751             const XalanNode*    sourceNode,
01752             const Locator*      locator) const = 0;
01753 
01754     virtual void
01755     message(
01756             const XalanDOMString&   msg,
01757             const XalanNode*        sourceNode = 0,
01758             const XalanNode*        styleNode = 0) const = 0;
01759 
01760     virtual void
01761     message(
01762             const XalanDOMString&   msg,
01763             const XalanNode*    sourceNode,
01764             const Locator*      locator) const = 0;
01765 
01766     virtual void
01767     message(
01768             const char*         msg,
01769             const XalanNode*    sourceNode = 0,
01770             const XalanNode*    styleNode = 0) const = 0;
01771 
01772     virtual void
01773     message(
01774             const char*         msg,
01775             const XalanNode*    sourceNode,
01776             const Locator*      locator) const = 0;
01777 };
01778 
01779 
01780 
01781 #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++ XSL Transformer Version 1.1
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.