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  

StylesheetExecutionContextDefault.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(STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
00060 #define STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
00061 
00062 
00063 
00064 // Base class include file.
00065 #include <XSLT/StylesheetExecutionContext.hpp>
00066 
00067 
00068 
00069 #include <ctime>
00070 #include <deque>
00071 #include <memory>
00072 #include <set>
00073 #include <vector>
00074 
00075 
00076 
00077 #include <Include/XalanObjectCache.hpp>
00078 
00079 
00080 
00081 #include <XPath/XPathExecutionContextDefault.hpp>
00082 
00083 
00084 
00085 #include <XMLSupport/FormatterToText.hpp>
00086 
00087 
00088 
00089 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
00090 #include <XalanSourceTree/XalanSourceTreeDocument.hpp>
00091 #endif
00092 #include <XalanSourceTree/FormatterToSourceTree.hpp>
00093 
00094 
00095 
00096 #include <XSLT/CountersTable.hpp>
00097 #include <XSLT/NodeSorter.hpp>
00098 #include <XSLT/Stylesheet.hpp>
00099 #include <XSLT/VariablesStack.hpp>
00100 
00101 
00102 
00103 class XalanSourceTreeDocument;
00104 class XPathProcessor;
00105 class XObjectFactory;
00106 class XSLTEngineImpl;
00107 
00108 
00109 
00110 //
00111 // An class which provides support for executing stylesheets.
00112 //
00113 class XALAN_XSLT_EXPORT StylesheetExecutionContextDefault : public StylesheetExecutionContext
00114 {
00115 public:
00116 
00117 #if defined(XALAN_NO_NAMESPACES)
00118     typedef deque<const ElemTemplateElement*>           ElementRecursionStackType;
00119     typedef vector<FormatterListener*>                  FormatterListenerVectorType;
00120     typedef vector<PrintWriter*>                        PrintWriterVectorType;
00121     typedef vector<XalanOutputStream*>                  OutputStreamVectorType;
00122     typedef set<const KeyDeclaration*,
00123                 less<const KeyDeclaration*> >           KeyDeclarationSetType;
00124     typedef pair<const XPath*, clock_t>                 XPathCacheEntry;
00125     typedef map<XalanDOMString,
00126                 XPathCacheEntry,
00127                 less<XalanDOMString> >                  XPathCacheMapType;
00128 #else
00129     typedef std::deque<const ElemTemplateElement*>      ElementRecursionStackType;
00130     typedef std::vector<FormatterListener*>             FormatterListenerVectorType;
00131     typedef std::vector<PrintWriter*>                   PrintWriterVectorType;
00132     typedef std::vector<XalanOutputStream*>             OutputStreamVectorType;
00133     typedef std::set<const KeyDeclaration*>             KeyDeclarationSetType;
00134     typedef std::pair<const XPath*, clock_t>            XPathCacheEntry;
00135     typedef std::map<XalanDOMString, XPathCacheEntry>   XPathCacheMapType;
00136 #endif
00137 
00138     typedef Stylesheet::KeyTablesTableType              KeyTablesTableType;
00139     typedef VariablesStack::ParamsVectorType            ParamsVectorType;
00140 
00141     
00152     StylesheetExecutionContextDefault(
00153             XSLTEngineImpl&         xsltProcessor,
00154             XPathEnvSupport&        theXPathEnvSupport,
00155             DOMSupport&             theDOMSupport,
00156             XObjectFactory&         theXObjectFactory,
00157             XalanNode*              theCurrentNode = 0,
00158             const NodeRefListBase*  theContextNodeList = 0,
00159             const PrefixResolver*   thePrefixResolver = 0);
00160 
00171     explicit
00172     StylesheetExecutionContextDefault(
00173             XalanNode*              theCurrentNode = 0,
00174             const NodeRefListBase*  theContextNodeList = 0,
00175             const PrefixResolver*   thePrefixResolver = 0);
00176 
00177     virtual
00178     ~StylesheetExecutionContextDefault();
00179 
00180 
00192     bool
00193     setIgnoreHTMLElementNamespaces() const
00194     {
00195         return m_ignoreHTMLElementNamespaces;
00196     }
00197 
00204     void
00205     setIgnoreHTMLElementNamespaces(bool     theValue)
00206     {
00207         m_ignoreHTMLElementNamespaces = theValue;
00208     }
00209 
00215     void
00216     setXPathEnvSupport(XPathEnvSupport*     theSupport)
00217     {
00218         m_xpathExecutionContextDefault.setXPathEnvSupport(theSupport);
00219     }
00220 
00226     void
00227     setXObjectFactory(XObjectFactory*   theFactory)
00228     {
00229         m_xpathExecutionContextDefault.setXObjectFactory(theFactory);
00230     }
00231 
00237     void
00238     setDOMSupport(DOMSupport*   theDOMSupport)
00239     {
00240         m_xpathExecutionContextDefault.setDOMSupport(theDOMSupport);
00241     }
00242 
00243 
00249     void
00250     setXSLTProcessor(XSLTEngineImpl*    theProcessor)
00251     {
00252         m_xsltProcessor = theProcessor;
00253     }
00254 
00255 
00256     // These interfaces are inherited from StylesheetExecutionContext...
00257 
00258     virtual bool
00259     getQuietConflictWarnings() const;
00260 
00261     virtual XalanNode*
00262     getRootDocument() const;
00263 
00264     virtual void
00265     setRootDocument(XalanNode*  theDocument);
00266 
00267     virtual XalanDocument*
00268     createDocument() const;
00269 
00270     virtual void
00271     setStylesheetRoot(const StylesheetRoot*     theStylesheet);
00272 
00273     virtual const XalanQName*
00274     getCurrentMode() const;
00275 
00276     virtual void
00277     setCurrentMode(const XalanQName*    theMode); 
00278 
00279     virtual bool
00280     doDiagnosticsOutput() const;
00281 
00282     virtual void
00283     diag(const XalanDOMString&  theString);
00284 
00285     virtual void
00286     pushTime(const void*    theKey);
00287 
00288     virtual void
00289     displayDuration(
00290             const XalanDOMString&   theMessage,
00291             const void*             theKey);
00292 
00293     virtual bool
00294     isElementPending() const;
00295 
00296     virtual void
00297     replacePendingAttribute(
00298             const XalanDOMChar*     theName,
00299             const XalanDOMChar*     theNewType,
00300             const XalanDOMChar*     theNewValue);
00301 
00302     virtual void
00303     pushOutputContext(FormatterListener*    flistener = 0);
00304 
00305     virtual void
00306     popOutputContext();
00307 
00308     virtual void
00309     addResultAttribute(
00310             const XalanDOMString&   aname,
00311             const XalanDOMString&   value);
00312 
00313     virtual void
00314     copyNamespaceAttributes(const XalanNode&    src);
00315 
00316     virtual const XalanDOMString*
00317     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const;
00318 
00319     virtual const XalanDOMString*
00320     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const;
00321 
00322     virtual bool
00323     isPendingResultPrefix(const XalanDOMString& thePrefix);
00324 
00325     virtual XalanDOMString
00326     getUniqueNamespaceValue() const;
00327 
00328     virtual void
00329     getUniqueNamespaceValue(XalanDOMString&     theValue) const;
00330 
00331     virtual FormatterListener*
00332     getFormatterListener() const;
00333 
00334     virtual void
00335     setFormatterListener(FormatterListener*     flistener);
00336 
00337     virtual int
00338     getIndent() const;
00339 
00340     // $$$ ToDo: Get rid of this!!!!
00341     virtual const XObjectPtr
00342     executeXPath(
00343             const XalanDOMString&   str,
00344             XalanNode*              contextNode,
00345             const XalanElement&     resolver);
00346 
00347     virtual const XPath*
00348     createMatchPattern(
00349             const XalanDOMString&   str,
00350             const PrefixResolver&   resolver);
00351 
00352     virtual void
00353     returnXPath(const XPath*    xpath);
00354 
00355     virtual void
00356     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
00357 
00358     virtual const XObjectPtr
00359     createVariable(
00360             const ElemTemplateElement*  element,
00361             const XPath&                xpath,
00362             XalanNode*                  contextNode,
00363             const PrefixResolver&       resolver);
00364 
00365     virtual const XObjectPtr
00366     createVariable(
00367             const ElemTemplateElement*  element,
00368             const ElemTemplateElement&  templateChild,
00369             XalanNode*                  sourceNode);
00370 
00371     virtual void
00372     pushVariable(
00373             const XalanQName&           name,
00374             const ElemTemplateElement*  element,
00375             const XalanDOMString&       str,
00376             XalanNode*                  contextNode,
00377             const PrefixResolver&       resolver);
00378 
00379     virtual void
00380     pushVariable(
00381             const XalanQName&           name,
00382             const XObjectPtr            val,
00383             const ElemTemplateElement*  element);
00384 
00385     virtual void
00386     pushVariable(
00387             const XalanQName&           name,
00388             const ElemVariable*         var,
00389             const ElemTemplateElement*  element);
00390 
00391     virtual void
00392     pushVariable(
00393             const XalanQName&           name,
00394             const ElemTemplateElement*  element,
00395             const XPath&                xpath,
00396             XalanNode*                  contextNode,
00397             const PrefixResolver&       resolver);
00398 
00399     virtual void
00400     pushVariable(
00401             const XalanQName&           name,
00402             const ElemTemplateElement*  element,
00403             const ElemTemplateElement&  templateChild,
00404             XalanNode*                  sourceNode);
00405 
00406     virtual void
00407     pushContextMarker();
00408 
00409     virtual void
00410     popContextMarker();
00411 
00412     virtual void
00413     resolveTopLevelParams();
00414 
00415     virtual void
00416     clearTopLevelParams();
00417 
00418     virtual void
00419     pushParams(
00420             const ElemTemplateElement&  xslCallTemplateElement,
00421             XalanNode*                  sourceNode,
00422             const ElemTemplateElement*  targetTemplate);
00423 
00424     virtual const XObjectPtr
00425     getParamVariable(const XalanQName&  theName);
00426 
00427     virtual void
00428     pushElementFrame(const ElemTemplateElement*     elem);
00429 
00430     virtual void
00431     popElementFrame(const ElemTemplateElement*  elem);
00432 
00433     virtual int
00434     getGlobalStackFrameIndex() const;
00435 
00436     virtual int
00437     getCurrentStackFrameIndex() const;
00438 
00439     virtual void
00440     setCurrentStackFrameIndex(int currentStackFrameIndex = -1);
00441 
00442     virtual void
00443     startDocument();
00444 
00445     virtual void
00446     endDocument();
00447 
00448     virtual void
00449     startElement(const XalanDOMChar*    name);
00450 
00451     virtual void
00452     endElement(const XalanDOMChar*  name);
00453 
00454     virtual void
00455     characters(
00456             const XalanDOMChar*     ch,
00457             unsigned int            start,
00458             unsigned int            length);
00459 
00460     virtual void
00461     charactersRaw(
00462             const XalanDOMChar*     ch,
00463             unsigned int            start,
00464             unsigned int            length);
00465 
00466     virtual void
00467     comment(const XalanDOMChar*     data);
00468 
00469     virtual void
00470     processingInstruction(
00471             const XalanDOMChar*     target,
00472             const XalanDOMChar*     data);
00473 
00474     virtual void
00475     flushPending();
00476 
00477     virtual void
00478     cloneToResultTree(
00479             XalanNode&              node,
00480             XalanNode::NodeType     nodeType,
00481             bool                    isLiteral,
00482             bool                    overrideStrip,
00483             bool                    shouldCloneAttributes);
00484 
00485     virtual const XObjectPtr
00486     createXResultTreeFrag(
00487             const ElemTemplateElement&  templateChild,
00488             XalanNode*                  sourceNode);
00489 
00490     virtual void
00491     outputToResultTree(const XObject&   xobj);
00492 
00493     virtual void
00494     outputResultTreeFragment(const XObject&     theTree);
00495 
00496     virtual const XalanDOMString&
00497     getXSLNameSpaceURL() const;
00498 
00499     virtual const XalanDOMString&
00500     getXalanXSLNameSpaceURL() const;
00501 
00502     virtual bool
00503     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const;
00504 
00505     virtual void
00506     pushOnElementRecursionStack(const ElemTemplateElement*  theElement);
00507 
00508     virtual const ElemTemplateElement*
00509     popElementRecursionStack();
00510 
00511     virtual FormatterToXML*
00512     createFormatterToXML(
00513             Writer&                 writer,
00514             const XalanDOMString&   version = XalanDOMString(),
00515             bool                    doIndent = false,
00516             int                     indent = 0,
00517             const XalanDOMString&   encoding = XalanDOMString(),
00518             const XalanDOMString&   mediaType = XalanDOMString(),
00519             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00520             const XalanDOMString&   doctypePublic = XalanDOMString(),
00521             bool                    xmlDecl = true,
00522             const XalanDOMString&   standalone = XalanDOMString());
00523 
00524     virtual FormatterToHTML*
00525     createFormatterToHTML(
00526             Writer&                 writer,
00527             const XalanDOMString&   encoding = XalanDOMString(),
00528             const XalanDOMString&   mediaType = XalanDOMString(),
00529             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00530             const XalanDOMString&   doctypePublic = XalanDOMString(),
00531             bool                    doIndent = true,
00532             int                     indent = 4,
00533             const XalanDOMString&   version = XalanDOMString(),
00534             const XalanDOMString&   standalone = XalanDOMString(),
00535             bool                    xmlDecl = false);
00536 
00537     virtual FormatterToDOM*
00538     createFormatterToDOM(
00539             XalanDocument*          doc,
00540             XalanDocumentFragment*  docFrag,
00541             XalanElement*           currentElement);
00542 
00543     virtual FormatterToDOM*
00544     createFormatterToDOM(
00545             XalanDocument*  doc,
00546             XalanElement*   elem);
00547 
00548     virtual FormatterToText*
00549     createFormatterToText(
00550             Writer&                 writer,
00551             const XalanDOMString&   encoding);
00552 
00553     virtual FormatterToText*
00554     borrowFormatterToText();
00555 
00556     virtual bool
00557     returnFormatterToText(FormatterToText*  theFormatter);
00558 
00559     virtual NodeSorter*
00560     borrowNodeSorter();
00561 
00562     virtual bool
00563     returnNodeSorter(NodeSorter*    theSorter);
00564 
00565     virtual XalanNumberFormatAutoPtr
00566     createXalanNumberFormat();
00567 
00568     // A basic class to create XalanNumberFormat instances...
00569     class XALAN_XSLT_EXPORT XalanNumberFormatFactory
00570     {
00571     public:
00572 
00573         explicit
00574         XalanNumberFormatFactory();
00575 
00576         virtual
00577         ~XalanNumberFormatFactory();
00578 
00579         virtual XalanNumberFormat*
00580         create();
00581     };
00582 
00583     static XalanNumberFormatFactory&
00584     getDefaultXalanNumberFormatFactory()
00585     {
00586         return s_defaultXalanNumberFormatFactory;
00587     }
00588 
00596     static XalanNumberFormatFactory*
00597     installXalanNumberFormatFactory(XalanNumberFormatFactory*   theFactory);
00598 
00599 
00600     virtual unsigned long
00601     getTraceListeners() const;
00602 
00603     virtual void
00604     fireGenerateEvent(const GenerateEvent&  ge);
00605 
00606     virtual void
00607     fireTraceEvent(const TracerEvent&   te);
00608 
00609     virtual void
00610     fireSelectEvent(const SelectionEvent&   se);
00611 
00612     virtual bool
00613     getTraceSelects() const;
00614 
00615     virtual void
00616     traceSelect(
00617             const XalanElement&     theTemplate,
00618             const NodeRefListBase&  nl) const;
00619 
00620     virtual int
00621     collationCompare(
00622             const XalanDOMString&   theLHS,
00623             const XalanDOMString&   theRHS);
00624 
00625     virtual int
00626     collationCompare(
00627             const XalanDOMString&   theLHS,
00628             const XalanDOMString&   theRHS,
00629             const XalanDOMString&   theLocale);
00630 
00631     virtual int
00632     collationCompare(
00633             const XalanDOMChar*     theLHS,
00634             const XalanDOMChar*     theRHS);
00635 
00636     virtual int
00637     collationCompare(
00638             const XalanDOMChar*     theLHS,
00639             const XalanDOMChar*     theRHS,
00640             const XalanDOMChar*     theLocale);
00641 
00642     class XALAN_XSLT_EXPORT CollationCompareFunctor
00643     {
00644     public:
00645 
00646         CollationCompareFunctor();
00647 
00648         virtual
00649         ~CollationCompareFunctor();
00650 
00651         // Non-const version is suitable for use by
00652         // a singe thread.
00653         virtual int
00654         operator()(
00655             const XalanDOMChar*     theLHS,
00656             const XalanDOMChar*     theRHS) = 0;
00657 
00658         // Const version is suitable for use by
00659         // multiple threads.
00660         virtual int
00661         operator()(
00662             const XalanDOMChar*     theLHS,
00663             const XalanDOMChar*     theRHS) const = 0;
00664 
00665         // Const version is suitable for use by
00666         // multiple threads.
00667         virtual int
00668         operator()(
00669             const XalanDOMChar*     theLHS,
00670             const XalanDOMChar*     theRHS,
00671             const XalanDOMChar*     theLocale) const = 0;
00672     };
00673 
00674     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
00675     {
00676     public:
00677 
00678         DefaultCollationCompareFunctor();
00679 
00680         virtual
00681         ~DefaultCollationCompareFunctor();
00682 
00683         virtual int
00684         operator()(
00685             const XalanDOMChar*     theLHS,
00686             const XalanDOMChar*     theRHS);
00687 
00688         virtual int
00689         operator()(
00690             const XalanDOMChar*     theLHS,
00691             const XalanDOMChar*     theRHS) const;
00692 
00693         virtual int
00694         operator()(
00695             const XalanDOMChar*     theLHS,
00696             const XalanDOMChar*     theRHS,
00697             const XalanDOMChar*     theLocale) const;
00698     };
00699 
00700     CollationCompareFunctor*
00701     installCollationCompareFunctor(CollationCompareFunctor*     theFunctor);
00702 
00703     virtual bool
00704     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
00705 
00706     virtual void
00707     beginConstruction(const KeyDeclaration&     keyDeclaration);
00708 
00709     virtual void
00710     endConstruction(const KeyDeclaration&   keyDeclaration);
00711 
00712     virtual const XalanDecimalFormatSymbols*
00713     getDecimalFormatSymbols(const XalanDOMString&   name);
00714 
00715     virtual PrintWriter*
00716     createPrintWriter(XalanOutputStream*        theTextOutputStream);
00717 
00718     virtual PrintWriter*
00719     createPrintWriter(
00720             const XalanDOMString&       theFileName,
00721             const XalanDOMString&       theEncoding);
00722 
00723     virtual PrintWriter*
00724 #if defined(XALAN_NO_NAMESPACES)
00725     createPrintWriter(ostream&          theStream);
00726 #else
00727     createPrintWriter(std::ostream&     theStream);
00728 #endif
00729 
00730     virtual CountersTable&
00731     getCountersTable();
00732 
00733     virtual void
00734     characters(const XalanNode&     node);
00735 
00736     virtual void
00737     characters(const XObjectPtr&    xobject);
00738 
00739     virtual void
00740     charactersRaw(const XalanNode&  node);
00741 
00742     virtual void
00743     charactersRaw(const XObjectPtr&     xobject);
00744 
00745 
00746     // These interfaces are inherited from XPathExecutionContext...
00747 
00748     virtual void
00749     reset();
00750 
00751     virtual XalanNode*
00752     getCurrentNode() const;
00753 
00754     virtual void
00755     setCurrentNode(XalanNode*   theCurrentNode);
00756 
00757     virtual XObjectFactory&
00758     getXObjectFactory() const;
00759 
00760     virtual XObjectPtr
00761     createNodeSet(XalanNode&    theNode);
00762 
00763     virtual bool
00764     isNodeAfter(
00765             const XalanNode&    node1,
00766             const XalanNode&    node2) const;
00767 
00768     virtual const NodeRefListBase&
00769     getContextNodeList() const;
00770 
00771     virtual void    
00772     setContextNodeList(const NodeRefListBase&   theList);
00773 
00774     virtual unsigned int
00775     getContextNodeListLength() const;
00776 
00777     virtual unsigned int
00778     getContextNodeListPosition(const XalanNode&     contextNode) const;
00779 
00780     virtual bool
00781     elementAvailable(
00782             const XalanDOMString&   theNamespace, 
00783             const XalanDOMString&   elementName) const;
00784 
00785     virtual bool
00786     functionAvailable(
00787             const XalanDOMString&   theNamespace, 
00788             const XalanDOMString&   functionName) const;
00789 
00790     virtual const XObjectPtr
00791     extFunction(
00792             const XalanDOMString&           theNamespace,
00793             const XalanDOMString&           functionName,
00794             XalanNode*                      context,
00795             const XObjectArgVectorType&     argVec);
00796 
00797     virtual XalanDocument*
00798     parseXML(
00799             const XalanDOMString&   urlString,
00800             const XalanDOMString&   base) const;
00801 
00802     virtual MutableNodeRefList*
00803     borrowMutableNodeRefList();
00804 
00805     virtual bool
00806     returnMutableNodeRefList(MutableNodeRefList*    theList);
00807 
00808     virtual ResultTreeFragBase*
00809     borrowResultTreeFrag();
00810 
00811     virtual bool
00812     returnResultTreeFrag(ResultTreeFragBase*    theResultTreeFragBase);
00813 
00814     virtual MutableNodeRefList*
00815     createMutableNodeRefList() const;
00816 
00817     virtual XalanDOMString&
00818     getCachedString();
00819 
00820     virtual bool
00821     releaseCachedString(XalanDOMString&     theString);
00822 
00823     virtual void
00824     getNodeSetByKey(            
00825             XalanNode*              doc,
00826             const XalanDOMString&   name,
00827             const XalanDOMString&   ref,
00828             const PrefixResolver&   resolver,
00829             MutableNodeRefList&     nodelist);
00830 
00831     virtual const XObjectPtr
00832     getVariable(const XalanQName&   name);
00833 
00834     virtual const PrefixResolver*
00835     getPrefixResolver() const;
00836 
00837     virtual void
00838     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
00839 
00840     virtual const XalanDOMString*
00841     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
00842 
00843     virtual XalanDOMString
00844     findURIFromDoc(const XalanDocument*     owner) const;
00845 
00846     virtual XalanDocument*
00847     getDOMFactory() const;
00848 
00849     virtual const XalanDOMString&
00850     getUnparsedEntityURI(
00851             const XalanDOMString&   theName,
00852             const XalanDocument&    theDocument) const;
00853 
00854     virtual bool
00855     shouldStripSourceNode(const XalanNode&  node);
00856 
00857     virtual bool
00858     getThrowFoundIndex() const;
00859 
00860     virtual void
00861     setThrowFoundIndex(bool     fThrow);
00862 
00863     virtual XalanDocument*
00864     getSourceDocument(const XalanDOMString&     theURI) const;
00865 
00866     virtual void
00867     setSourceDocument(
00868             const XalanDOMString&   theURI,
00869             XalanDocument*          theDocument);
00870 
00871 
00872     // These interfaces are inherited from ExecutionContext...
00873 
00874     virtual void
00875     error(
00876             const XalanDOMString&   msg,
00877             const XalanNode*        sourceNode = 0,
00878             const XalanNode*        styleNode = 0) const;
00879 
00880     virtual void
00881     error(
00882             const XalanDOMString&   msg,
00883             const XalanNode*        sourceNode,
00884             const Locator*          locator) const;
00885 
00886     virtual void
00887     error(
00888             const char*         msg,
00889             const XalanNode*    sourceNode = 0,
00890             const XalanNode*    styleNode = 0) const;
00891 
00892     virtual void
00893     error(
00894             const char*         msg,
00895             const XalanNode*    sourceNode,
00896             const Locator*      locator) const;
00897 
00898     virtual void
00899     warn(
00900             const XalanDOMString&   msg,
00901             const XalanNode*        sourceNode = 0,
00902             const XalanNode*        styleNode = 0) const;
00903 
00904     virtual void
00905     warn(
00906             const XalanDOMString&   msg,
00907             const XalanNode*        sourceNode,
00908             const Locator*          locator) const;
00909 
00910     virtual void
00911     warn(
00912             const char*         msg,
00913             const XalanNode*    sourceNode = 0,
00914             const XalanNode*    styleNode = 0) const;
00915 
00916     virtual void
00917     warn(
00918             const char*         msg,
00919             const XalanNode*    sourceNode,
00920             const Locator*      locator) const;
00921 
00922     virtual void
00923     message(
00924             const XalanDOMString&   msg,
00925             const XalanNode*        sourceNode = 0,
00926             const XalanNode*        styleNode = 0) const;
00927 
00928     virtual void
00929     message(
00930             const XalanDOMString&   msg,
00931             const XalanNode*    sourceNode,
00932             const Locator*      locator) const;
00933 
00934     virtual void
00935     message(
00936             const char*         msg,
00937             const XalanNode*    sourceNode = 0,
00938             const XalanNode*    styleNode = 0) const;
00939 
00940     virtual void
00941     message(
00942             const char*         msg,
00943             const XalanNode*    sourceNode,
00944             const Locator*      locator) const;
00945 
00946 
00947     class XPathCacheReturnFunctor
00948     {
00949     public:
00950 
00951         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
00952             m_xsltProcessor(xsltProcessor)
00953         {
00954         }
00955 
00956         void
00957         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
00958 
00959     private:
00960 
00961         XSLTEngineImpl&     m_xsltProcessor;
00962     };
00963 
00964 private:
00965 
00974     void
00975     getParams(
00976             const ElemTemplateElement&  xslCallTemplateElement,
00977             XalanNode*                  sourceNode,
00978             ParamsVectorType&           params);
00979 
00984     XalanSourceTreeDocument*
00985     getSourceTreeFactory() const;
00986 
00993     bool
00994     isCached(const XPath*   theXPath);
00995 
00999     void
01000     clearXPathCache();
01001 
01009     void
01010     addToXPathCache(
01011             const XalanDOMString&   pattern,
01012             const XPath*            theXPath);
01013 
01014 
01018     void
01019     cleanUpTransients();
01020 
01021     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
01022 
01023     // $$ ToDo: Try to remove this dependency, and rely only on XSLTProcessor...
01024     XSLTEngineImpl*                 m_xsltProcessor;
01025 
01026     XalanNode*                      m_rootDocument;
01027 
01028     enum { eXPathCacheMax = 50,
01029            eDefaultParamsVectorSize = 10 };
01030 
01031     ElementRecursionStackType           m_elementRecursionStack;
01032 
01033     const PrefixResolver*               m_prefixResolver;
01034 
01035     const StylesheetRoot*               m_stylesheetRoot;
01036 
01037     FormatterListenerVectorType         m_formatterListeners;
01038 
01039     PrintWriterVectorType               m_printWriters;
01040 
01041     OutputStreamVectorType              m_outputStreams;
01042 
01043     CollationCompareFunctor*            m_collationCompareFunctor;
01044 
01048     VariablesStack                      m_variablesStack;
01049 
01050     ParamsVectorType                    m_paramsVector;
01051 
01052     XPathCacheMapType                   m_matchPatternCache;
01053 
01054     KeyTablesTableType                  m_keyTables;
01055 
01056     KeyDeclarationSetType               m_keyDeclarationSet;
01057 
01058     CountersTable                       m_countersTable;
01059 
01060     // If true, we will not check HTML output for elements with
01061     // namespaces.  This is an optimization which can lead to
01062     // non-conforming behavior.
01063     bool                                m_ignoreHTMLElementNamespaces;
01064 
01069     mutable XalanAutoPtr<XalanSourceTreeDocument>   m_sourceTreeResultTreeFactory;
01070 
01071     // Holds the current mode.
01072     const XalanQName*                   m_mode;
01073 
01074     typedef XalanObjectCacheDefault<FormatterToText>        FormatterToTextCacheType;
01075     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
01076     typedef XalanObjectCacheDefault<NodeSorter>             NodeSorterCacheType;
01077 
01078     FormatterToTextCacheType            m_formatterToTextCache;
01079 
01080     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
01081 
01082     NodeSorterCacheType                 m_nodeSorterCache;
01083 
01084     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
01085 
01086     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
01087 
01088     const static DefaultCollationCompareFunctor     s_defaultCollationFunctor;
01089 };
01090 
01091 
01092 
01093 #endif  // STYLESHEETEXECUTIONCONTEXTDEFAULT_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.