Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.4

Main Page   Namespace List   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-2002 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 #include <XalanSourceTree/XalanSourceTreeDocumentFragment.hpp>
00094 
00095 
00096 
00097 #include <XSLT/CountersTable.hpp>
00098 #include <XSLT/NodeSorter.hpp>
00099 #include <XSLT/ResultTreeFrag.hpp>
00100 #include <XSLT/ResultTreeFragAllocator.hpp>
00101 #include <XSLT/Stylesheet.hpp>
00102 #include <XSLT/VariablesStack.hpp>
00103 #include <XSLT/XResultTreeFragAllocator.hpp>
00104 #include <XSLT/XalanSourceTreeDocumentAllocator.hpp>
00105 #include <XSLT/XalanSourceTreeDocumentFragmentAllocator.hpp>
00106 
00107 
00108 
00109 class XalanSourceTreeDocument;
00110 class XPathProcessor;
00111 class XSLTEngineImpl;
00112 
00113 
00114 
00115 //
00116 // An class which provides support for executing stylesheets.
00117 //
00118 class XALAN_XSLT_EXPORT StylesheetExecutionContextDefault : public StylesheetExecutionContext
00119 {
00120 public:
00121 
00122 #if defined(XALAN_STRICT_ANSI_HEADERS)
00123     typedef std::clock_t    ClockType;
00124 #else
00125     typedef clock_t         ClockType;
00126 #endif
00127 
00128 #if defined(XALAN_NO_NAMESPACES)
00129     typedef deque<const ElemTemplateElement*>           ElementRecursionStackType;
00130     typedef vector<FormatterListener*>                  FormatterListenerVectorType;
00131     typedef vector<PrintWriter*>                        PrintWriterVectorType;
00132     typedef vector<XalanOutputStream*>                  OutputStreamVectorType;
00133     typedef set<const KeyDeclaration*,
00134                 less<const KeyDeclaration*> >           KeyDeclarationSetType;
00135     typedef pair<const XPath*, ClockType>               XPathCacheEntry;
00136     typedef map<XalanDOMString,
00137                 XPathCacheEntry,
00138                 less<XalanDOMString> >                  XPathCacheMapType;
00139 #else
00140     typedef std::deque<const ElemTemplateElement*>      ElementRecursionStackType;
00141     typedef std::vector<FormatterListener*>             FormatterListenerVectorType;
00142     typedef std::vector<PrintWriter*>                   PrintWriterVectorType;
00143     typedef std::vector<XalanOutputStream*>             OutputStreamVectorType;
00144     typedef std::set<const KeyDeclaration*>             KeyDeclarationSetType;
00145     typedef std::pair<const XPath*, ClockType>          XPathCacheEntry;
00146     typedef std::map<XalanDOMString, XPathCacheEntry>   XPathCacheMapType;
00147 #endif
00148 
00149     typedef Stylesheet::KeyTablesTableType              KeyTablesTableType;
00150     typedef VariablesStack::ParamsVectorType            ParamsVectorType;
00151 
00152     
00163     StylesheetExecutionContextDefault(
00164             XSLTEngineImpl&         xsltProcessor,
00165             XPathEnvSupport&        theXPathEnvSupport,
00166             DOMSupport&             theDOMSupport,
00167             XObjectFactory&         theXObjectFactory,
00168             XalanNode*              theCurrentNode = 0,
00169             const NodeRefListBase*  theContextNodeList = 0,
00170             const PrefixResolver*   thePrefixResolver = 0);
00171 
00182     explicit
00183     StylesheetExecutionContextDefault(
00184             XalanNode*              theCurrentNode = 0,
00185             const NodeRefListBase*  theContextNodeList = 0,
00186             const PrefixResolver*   thePrefixResolver = 0);
00187 
00188     virtual
00189     ~StylesheetExecutionContextDefault();
00190 
00191 
00203     bool
00204     setIgnoreHTMLElementNamespaces() const
00205     {
00206         return m_ignoreHTMLElementNamespaces;
00207     }
00208 
00215     void
00216     setIgnoreHTMLElementNamespaces(bool     theValue)
00217     {
00218         m_ignoreHTMLElementNamespaces = theValue;
00219     }
00220 
00226     void
00227     setXPathEnvSupport(XPathEnvSupport*     theSupport)
00228     {
00229         m_xpathExecutionContextDefault.setXPathEnvSupport(theSupport);
00230     }
00231 
00237     void
00238     setDOMSupport(DOMSupport*   theDOMSupport)
00239     {
00240         m_xpathExecutionContextDefault.setDOMSupport(theDOMSupport);
00241     }
00242 
00248     void
00249     setXObjectFactory(XObjectFactory*   theXObjectFactory)
00250     {
00251         m_xpathExecutionContextDefault.setXObjectFactory(theXObjectFactory);
00252 
00253         m_xobjectFactory = theXObjectFactory;
00254     }
00255 
00256 
00262     void
00263     setXSLTProcessor(XSLTEngineImpl*    theProcessor)
00264     {
00265         m_xsltProcessor = theProcessor;
00266     }
00267 
00268     bool
00269     getUsePerInstanceDocumentFactory() const
00270     {
00271         return m_usePerInstanceDocumentFactory;
00272     }
00273 
00274     void
00275     setUsePerInstanceDocumentFactory(bool   fValue)
00276     {
00277         m_usePerInstanceDocumentFactory = fValue;
00278     }
00279 
00280 
00281     // These interfaces are inherited from StylesheetExecutionContext...
00282 
00283     virtual bool
00284     getQuietConflictWarnings() const;
00285 
00286     virtual bool
00287     getCopyTextNodesOnly() const;
00288 
00289     virtual void
00290     setCopyTextNodesOnly(bool   fValue);
00291 
00292     virtual XalanNode*
00293     getRootDocument() const;
00294 
00295     virtual void
00296     setRootDocument(XalanNode*  theDocument);
00297 
00298     virtual XalanDocument*
00299     createDocument() const;
00300 
00301     virtual void
00302     setStylesheetRoot(const StylesheetRoot*     theStylesheet);
00303 
00304     virtual const XalanQName*
00305     getCurrentMode() const;
00306 
00307     virtual void
00308     setCurrentMode(const XalanQName*    theMode); 
00309 
00310     virtual const ElemTemplate*
00311     getCurrentTemplate() const;
00312 
00313     virtual void
00314     setCurrentTemplate(const ElemTemplate*  theTemplate); 
00315 
00316     virtual bool
00317     doDiagnosticsOutput() const;
00318 
00319     virtual void
00320     diag(const XalanDOMString&  theString);
00321 
00322     virtual void
00323     pushTime(const void*    theKey);
00324 
00325     virtual void
00326     displayDuration(
00327             const XalanDOMString&   theMessage,
00328             const void*             theKey);
00329 
00330     virtual bool
00331     isElementPending() const;
00332 
00333     virtual void
00334     replacePendingAttribute(
00335             const XalanDOMChar*     theName,
00336             const XalanDOMChar*     theNewType,
00337             const XalanDOMChar*     theNewValue);
00338 
00339     virtual void
00340     pushOutputContext(FormatterListener*    flistener = 0);
00341 
00342     virtual void
00343     popOutputContext();
00344 
00345     virtual void
00346     addResultAttribute(
00347             const XalanDOMString&   aname,
00348             const XalanDOMString&   value);
00349 
00350     virtual void
00351     copyNamespaceAttributes(const XalanNode&    src);
00352 
00353     virtual const XalanDOMString*
00354     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const;
00355 
00356     virtual const XalanDOMString*
00357     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const;
00358 
00359     virtual bool
00360     isPendingResultPrefix(const XalanDOMString& thePrefix);
00361 
00362     virtual XalanDOMString
00363     getUniqueNamespaceValue() const;
00364 
00365     virtual void
00366     getUniqueNamespaceValue(XalanDOMString&     theValue) const;
00367 
00368     virtual FormatterListener*
00369     getFormatterListener() const;
00370 
00371     virtual void
00372     setFormatterListener(FormatterListener*     flistener);
00373 
00374     virtual int
00375     getIndent() const;
00376 
00377     virtual void
00378     setIndent(int   indentAmount);
00379 
00380     // $$$ ToDo: Get rid of this!!!!
00381     virtual const XObjectPtr
00382     executeXPath(
00383             const XalanDOMString&   str,
00384             XalanNode*              contextNode,
00385             const XalanElement&     resolver);
00386 
00387     virtual const XPath*
00388     createMatchPattern(
00389             const XalanDOMString&   str,
00390             const PrefixResolver&   resolver);
00391 
00392     virtual void
00393     returnXPath(const XPath*    xpath);
00394 
00395     virtual void
00396     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
00397 
00398     virtual const XObjectPtr
00399     createVariable(
00400             const ElemTemplateElement*  element,
00401             const XPath&                xpath,
00402             XalanNode*                  contextNode,
00403             const PrefixResolver&       resolver);
00404 
00405     virtual const XObjectPtr
00406     createVariable(
00407             const ElemTemplateElement*  element,
00408             const ElemTemplateElement&  templateChild,
00409             XalanNode*                  sourceNode);
00410 
00411     virtual void
00412     pushVariable(
00413             const XalanQName&           name,
00414             const ElemTemplateElement*  element,
00415             const XalanDOMString&       str,
00416             XalanNode*                  contextNode,
00417             const PrefixResolver&       resolver);
00418 
00419     virtual void
00420     pushVariable(
00421             const XalanQName&           name,
00422             const XObjectPtr            val,
00423             const ElemTemplateElement*  element);
00424 
00425     virtual void
00426     pushVariable(
00427             const XalanQName&           name,
00428             const ElemVariable*         var,
00429             const ElemTemplateElement*  element);
00430 
00431     virtual void
00432     pushVariable(
00433             const XalanQName&           name,
00434             const ElemTemplateElement*  element,
00435             const XPath&                xpath,
00436             XalanNode*                  contextNode,
00437             const PrefixResolver&       resolver);
00438 
00439     virtual void
00440     pushVariable(
00441             const XalanQName&           name,
00442             const ElemTemplateElement*  element,
00443             const ElemTemplateElement&  templateChild,
00444             XalanNode*                  sourceNode);
00445 
00446     virtual void
00447     pushContextMarker();
00448 
00449     virtual void
00450     popContextMarker();
00451 
00452     virtual void
00453     resolveTopLevelParams();
00454 
00455     virtual void
00456     clearTopLevelParams();
00457 
00458     virtual void
00459     pushParams(
00460             const ElemTemplateElement&  xslCallTemplateElement,
00461             XalanNode*                  sourceNode,
00462             const ElemTemplateElement*  targetTemplate);
00463 
00464     virtual const XObjectPtr
00465     getParamVariable(const XalanQName&  theName);
00466 
00467     virtual void
00468     pushElementFrame(const ElemTemplateElement*     elem);
00469 
00470     virtual void
00471     popElementFrame(const ElemTemplateElement*  elem);
00472 
00473     virtual int
00474     getGlobalStackFrameIndex() const;
00475 
00476     virtual int
00477     getCurrentStackFrameIndex() const;
00478 
00479     virtual void
00480     setCurrentStackFrameIndex(int currentStackFrameIndex = -1);
00481 
00482     virtual void
00483     startDocument();
00484 
00485     virtual void
00486     endDocument();
00487 
00488     virtual void
00489     startElement(const XalanDOMChar*    name);
00490 
00491     virtual void
00492     endElement(const XalanDOMChar*  name);
00493 
00494     virtual void
00495     characters(
00496             const XalanDOMChar*         ch,
00497             XalanDOMString::size_type   start,
00498             XalanDOMString::size_type   length);
00499 
00500     virtual void
00501     charactersRaw(
00502             const XalanDOMChar*         ch,
00503             XalanDOMString::size_type   start,
00504             XalanDOMString::size_type   length);
00505 
00506     virtual void
00507     comment(const XalanDOMChar*     data);
00508 
00509     virtual void
00510     processingInstruction(
00511             const XalanDOMChar*     target,
00512             const XalanDOMChar*     data);
00513 
00514     virtual void
00515     flushPending();
00516 
00517     virtual void
00518     cloneToResultTree(
00519             const XalanNode&            node,
00520             const ElemTemplateElement*  styleNode);
00521 
00522     virtual void
00523     cloneToResultTree(
00524             const XalanNode&            node,
00525             XalanNode::NodeType         nodeType,
00526             bool                        isLiteral,
00527             bool                        overrideStrip,
00528             bool                        shouldCloneAttributes,
00529             const ElemTemplateElement*  styleNode);
00530 
00531     virtual const XObjectPtr
00532     createXResultTreeFrag(
00533             const ElemTemplateElement&  templateChild,
00534             XalanNode*                  sourceNode);
00535 
00536     virtual void
00537     outputToResultTree(
00538             const XObject&              xobj,
00539             const ElemTemplateElement*  styleNode);
00540 
00541     virtual void
00542     outputResultTreeFragment(
00543             const XObject&              theTree,
00544             const ElemTemplateElement*  styleNode);
00545 
00546     virtual const XalanDOMString&
00547     getXSLNameSpaceURL() const;
00548 
00549     virtual const XalanDOMString&
00550     getXalanXSLNameSpaceURL() const;
00551 
00552     virtual bool
00553     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const;
00554 
00555     virtual void
00556     pushOnElementRecursionStack(const ElemTemplateElement*  theElement);
00557 
00558     virtual const ElemTemplateElement*
00559     popElementRecursionStack();
00560 
00561     virtual bool
00562     returnXResultTreeFrag(XResultTreeFrag*  theXResultTreeFrag);
00563 
00564     virtual eEscapeURLs
00565     getEscapeURLs() const;
00566 
00567     virtual void
00568     setEscapeURLs(eEscapeURLs   value);
00569 
00570     virtual eOmitMETATag
00571     getOmitMETATag() const;
00572 
00573     void
00574     setOmitMETATag(eOmitMETATag     value);
00575 
00576     virtual FormatterToXML*
00577     createFormatterToXML(
00578             Writer&                 writer,
00579             const XalanDOMString&   version = XalanDOMString(),
00580             bool                    doIndent = false,
00581             int                     indent = eDefaultXMLIndentAmount,
00582             const XalanDOMString&   encoding = XalanDOMString(),
00583             const XalanDOMString&   mediaType = XalanDOMString(),
00584             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00585             const XalanDOMString&   doctypePublic = XalanDOMString(),
00586             bool                    xmlDecl = true,
00587             const XalanDOMString&   standalone = XalanDOMString());
00588 
00589     virtual FormatterToHTML*
00590     createFormatterToHTML(
00591             Writer&                 writer,
00592             const XalanDOMString&   encoding = XalanDOMString(),
00593             const XalanDOMString&   mediaType = XalanDOMString(),
00594             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00595             const XalanDOMString&   doctypePublic = XalanDOMString(),
00596             bool                    doIndent = true,
00597             int                     indent = eDefaultHTMLIndentAmount,
00598             bool                    escapeURLs = true,
00599             bool                    omitMetaTag = false);
00600 
00601     virtual FormatterToDOM*
00602     createFormatterToDOM(
00603             XalanDocument*          doc,
00604             XalanDocumentFragment*  docFrag,
00605             XalanElement*           currentElement);
00606 
00607     virtual FormatterToDOM*
00608     createFormatterToDOM(
00609             XalanDocument*  doc,
00610             XalanElement*   elem);
00611 
00612     virtual FormatterToText*
00613     createFormatterToText(
00614             Writer&                 writer,
00615             const XalanDOMString&   encoding);
00616 
00617     virtual FormatterToText*
00618     borrowFormatterToText();
00619 
00620     virtual bool
00621     returnFormatterToText(FormatterToText*  theFormatter);
00622 
00623     virtual NodeSorter*
00624     borrowNodeSorter();
00625 
00626     virtual bool
00627     returnNodeSorter(NodeSorter*    theSorter);
00628 
00629     virtual XalanNumberFormatAutoPtr
00630     createXalanNumberFormat();
00631 
00632     // A basic class to create XalanNumberFormat instances...
00633     class XALAN_XSLT_EXPORT XalanNumberFormatFactory
00634     {
00635     public:
00636 
00637         explicit
00638         XalanNumberFormatFactory();
00639 
00640         virtual
00641         ~XalanNumberFormatFactory();
00642 
00643         virtual XalanNumberFormat*
00644         create();
00645     };
00646 
00647     static XalanNumberFormatFactory&
00648     getDefaultXalanNumberFormatFactory()
00649     {
00650         return s_defaultXalanNumberFormatFactory;
00651     }
00652 
00660     static XalanNumberFormatFactory*
00661     installXalanNumberFormatFactory(XalanNumberFormatFactory*   theFactory);
00662 
00663 
00664     virtual size_type
00665     getTraceListeners() const;
00666 
00667     virtual void
00668     fireGenerateEvent(const GenerateEvent&  ge);
00669 
00670     virtual void
00671     fireTraceEvent(const TracerEvent&   te);
00672 
00673     virtual void
00674     fireSelectEvent(const SelectionEvent&   se);
00675 
00676     virtual bool
00677     getTraceSelects() const;
00678 
00679     virtual void
00680     traceSelect(
00681             const ElemTemplateElement&  theStylesheetElement,
00682             const NodeRefListBase&      nl,
00683             const XPath*                xpath);
00684 
00685     virtual int
00686     collationCompare(
00687             const XalanDOMString&   theLHS,
00688             const XalanDOMString&   theRHS,
00689             eCaseOrder              theCaseOrder = eDefault);
00690 
00691     virtual int
00692     collationCompare(
00693             const XalanDOMString&   theLHS,
00694             const XalanDOMString&   theRHS,
00695             const XalanDOMString&   theLocale,
00696             eCaseOrder              theCaseOrder = eDefault);
00697 
00698     virtual int
00699     collationCompare(
00700             const XalanDOMChar*     theLHS,
00701             const XalanDOMChar*     theRHS,
00702             eCaseOrder              theCaseOrder = eDefault);
00703 
00704     virtual int
00705     collationCompare(
00706             const XalanDOMChar*     theLHS,
00707             const XalanDOMChar*     theRHS,
00708             const XalanDOMChar*     theLocale,
00709             eCaseOrder              theCaseOrder = eDefault);
00710 
00711     class XALAN_XSLT_EXPORT CollationCompareFunctor
00712     {
00713     public:
00714 
00715         CollationCompareFunctor();
00716 
00717         virtual
00718         ~CollationCompareFunctor();
00719 
00720         // Const version is suitable for use by
00721         // multiple threads.
00722         virtual int
00723         operator()(
00724             const XalanDOMChar*     theLHS,
00725             const XalanDOMChar*     theRHS,
00726             eCaseOrder              theCaseOrder = eDefault) const = 0;
00727 
00728         // Const version is suitable for use by
00729         // multiple threads.
00730         virtual int
00731         operator()(
00732             const XalanDOMChar*     theLHS,
00733             const XalanDOMChar*     theRHS,
00734             const XalanDOMChar*     theLocale,
00735             eCaseOrder              theCaseOrder = eDefault) const = 0;
00736     };
00737 
00738     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
00739     {
00740     public:
00741 
00742         DefaultCollationCompareFunctor();
00743 
00744         virtual
00745         ~DefaultCollationCompareFunctor();
00746 
00747         virtual int
00748         operator()(
00749             const XalanDOMChar*     theLHS,
00750             const XalanDOMChar*     theRHS,
00751             eCaseOrder              theCaseOrder = eDefault) const;
00752 
00753         virtual int
00754         operator()(
00755             const XalanDOMChar*     theLHS,
00756             const XalanDOMChar*     theRHS,
00757             const XalanDOMChar*     theLocale,
00758             eCaseOrder              theCaseOrder = eDefault) const;
00759     };
00760 
00761     const CollationCompareFunctor*
00762     installCollationCompareFunctor(CollationCompareFunctor*     theFunctor);
00763 
00764     CollationCompareFunctor*
00765     uninstallCollationCompareFunctor();
00766 
00767     virtual bool
00768     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
00769 
00770     virtual void
00771     beginConstruction(const KeyDeclaration&     keyDeclaration);
00772 
00773     virtual void
00774     endConstruction(const KeyDeclaration&   keyDeclaration);
00775 
00776     virtual const XalanDecimalFormatSymbols*
00777     getDecimalFormatSymbols(const XalanQName&   qname);
00778 
00779     virtual PrintWriter*
00780     createPrintWriter(XalanOutputStream*        theTextOutputStream);
00781 
00782     virtual PrintWriter*
00783     createPrintWriter(
00784             const XalanDOMString&       theFileName,
00785             const XalanDOMString&       theEncoding);
00786 
00787     virtual PrintWriter*
00788 #if defined(XALAN_NO_NAMESPACES)
00789     createPrintWriter(ostream&          theStream);
00790 #else
00791     createPrintWriter(std::ostream&     theStream);
00792 #endif
00793 
00794     virtual CountersTable&
00795     getCountersTable();
00796 
00797     virtual void
00798     characters(const XalanNode&     node);
00799 
00800     virtual void
00801     characters(const XObjectPtr&    xobject);
00802 
00803     virtual void
00804     charactersRaw(const XalanNode&  node);
00805 
00806     virtual void
00807     charactersRaw(const XObjectPtr&     xobject);
00808 
00809 
00810     // These interfaces are inherited from XPathExecutionContext...
00811 
00812     virtual void
00813     reset();
00814 
00815     virtual XalanNode*
00816     getCurrentNode() const;
00817 
00818     virtual void
00819     setCurrentNode(XalanNode*   theCurrentNode);
00820 
00821     virtual XObjectPtr
00822     createNodeSet(XalanNode&    theNode);
00823 
00824     virtual bool
00825     isNodeAfter(
00826             const XalanNode&    node1,
00827             const XalanNode&    node2) const;
00828 
00829     virtual const NodeRefListBase&
00830     getContextNodeList() const;
00831 
00832     virtual void    
00833     setContextNodeList(const NodeRefListBase&   theList);
00834 
00835     virtual size_type
00836     getContextNodeListLength() const;
00837 
00838     virtual size_type
00839     getContextNodeListPosition(const XalanNode&     contextNode) const;
00840 
00841     virtual bool
00842     elementAvailable(
00843             const XalanDOMString&   theNamespace, 
00844             const XalanDOMString&   elementName) const;
00845 
00846     virtual bool
00847     functionAvailable(
00848             const XalanDOMString&   theNamespace, 
00849             const XalanDOMString&   functionName) const;
00850 
00851     virtual const XObjectPtr
00852     extFunction(
00853             const XalanDOMString&           theNamespace,
00854             const XalanDOMString&           functionName,
00855             XalanNode*                      context,
00856             const XObjectArgVectorType&     argVec,
00857             const Locator*                  locator);
00858 
00859     virtual XalanDocument*
00860     parseXML(
00861             const XalanDOMString&   urlString,
00862             const XalanDOMString&   base) const;
00863 
00864     virtual MutableNodeRefList*
00865     borrowMutableNodeRefList();
00866 
00867     virtual bool
00868     returnMutableNodeRefList(MutableNodeRefList*    theList);
00869 
00870     virtual MutableNodeRefList*
00871     createMutableNodeRefList() const;
00872 
00873     virtual XalanDOMString&
00874     getCachedString();
00875 
00876     virtual bool
00877     releaseCachedString(XalanDOMString&     theString);
00878 
00879     virtual void
00880     getNodeSetByKey(            
00881             XalanNode*              doc,
00882             const XalanDOMString&   name,
00883             const XalanDOMString&   ref,
00884             const PrefixResolver&   resolver,
00885             MutableNodeRefList&     nodelist);
00886 
00887     virtual const XObjectPtr
00888     getVariable(
00889             const XalanQName&   name,
00890             const Locator*      locator = 0);
00891 
00892     virtual const PrefixResolver*
00893     getPrefixResolver() const;
00894 
00895     virtual void
00896     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
00897 
00898     virtual const XalanDOMString*
00899     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
00900 
00901     virtual XalanDOMString
00902     findURIFromDoc(const XalanDocument*     owner) const;
00903 
00904     virtual const XalanDOMString&
00905     getUnparsedEntityURI(
00906             const XalanDOMString&   theName,
00907             const XalanDocument&    theDocument) const;
00908 
00909     virtual bool
00910     shouldStripSourceNode(const XalanNode&  node);
00911 
00912     virtual bool
00913     getThrowFoundIndex() const;
00914 
00915     virtual void
00916     setThrowFoundIndex(bool     fThrow);
00917 
00918     virtual XalanDocument*
00919     getSourceDocument(const XalanDOMString&     theURI) const;
00920 
00921     virtual void
00922     setSourceDocument(
00923             const XalanDOMString&   theURI,
00924             XalanDocument*          theDocument);
00925 
00926 
00927     // These interfaces are inherited from ExecutionContext...
00928 
00929     virtual void
00930     error(
00931             const XalanDOMString&   msg,
00932             const XalanNode*        sourceNode = 0,
00933             const XalanNode*        styleNode = 0) const;
00934 
00935     virtual void
00936     error(
00937             const XalanDOMString&   msg,
00938             const XalanNode*        sourceNode,
00939             const Locator*          locator) const;
00940 
00941     virtual void
00942     error(
00943             const char*         msg,
00944             const XalanNode*    sourceNode = 0,
00945             const XalanNode*    styleNode = 0) const;
00946 
00947     virtual void
00948     error(
00949             const char*         msg,
00950             const XalanNode*    sourceNode,
00951             const Locator*      locator) const;
00952 
00953     virtual void
00954     warn(
00955             const XalanDOMString&   msg,
00956             const XalanNode*        sourceNode = 0,
00957             const XalanNode*        styleNode = 0) const;
00958 
00959     virtual void
00960     warn(
00961             const XalanDOMString&   msg,
00962             const XalanNode*        sourceNode,
00963             const Locator*          locator) const;
00964 
00965     virtual void
00966     warn(
00967             const char*         msg,
00968             const XalanNode*    sourceNode = 0,
00969             const XalanNode*    styleNode = 0) const;
00970 
00971     virtual void
00972     warn(
00973             const char*         msg,
00974             const XalanNode*    sourceNode,
00975             const Locator*      locator) const;
00976 
00977     virtual void
00978     message(
00979             const XalanDOMString&   msg,
00980             const XalanNode*        sourceNode = 0,
00981             const XalanNode*        styleNode = 0) const;
00982 
00983     virtual void
00984     message(
00985             const XalanDOMString&   msg,
00986             const XalanNode*    sourceNode,
00987             const Locator*      locator) const;
00988 
00989     virtual void
00990     message(
00991             const char*         msg,
00992             const XalanNode*    sourceNode = 0,
00993             const XalanNode*    styleNode = 0) const;
00994 
00995     virtual void
00996     message(
00997             const char*         msg,
00998             const XalanNode*    sourceNode,
00999             const Locator*      locator) const;
01000 
01001 
01002     class XPathCacheReturnFunctor
01003     {
01004     public:
01005 
01006         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
01007             m_xsltProcessor(xsltProcessor)
01008         {
01009         }
01010 
01011         void
01012         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
01013 
01014     private:
01015 
01016         XSLTEngineImpl&     m_xsltProcessor;
01017     };
01018 
01023     XalanSourceTreeDocument*
01024     getSourceTreeFactory() const;
01025 
01026 private:
01027 
01036     void
01037     getParams(
01038             const ElemTemplateElement&  xslCallTemplateElement,
01039             XalanNode*                  sourceNode,
01040             ParamsVectorType&           params);
01041 
01048     bool
01049     isCached(const XPath*   theXPath);
01050 
01054     void
01055     clearXPathCache();
01056 
01064     void
01065     addToXPathCache(
01066             const XalanDOMString&   pattern,
01067             const XPath*            theXPath);
01068 
01069 
01073     void
01074     cleanUpTransients();
01075 
01076     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
01077 
01078     XSLTEngineImpl*                 m_xsltProcessor;
01079 
01080     XalanNode*                      m_rootDocument;
01081 
01082     enum { eXPathCacheMax = 50,
01083            eDefaultParamsVectorSize = 10,
01084            eXResultTreeFragAllocatorBlockSize = 10,
01085            eResultTreeFragAllocatorBlockSize = 10,
01086            eDocumentAllocatorBlockSize = 10,
01087            eDocumentFragmentAllocatorBlockSize = 10,
01088            eDefaultAttributeAllocatorBlockSize = 10,
01089            eDefaultAttributeNSAllocatorBlockSize = 10,
01090            eDefaultCommentAllocatorBlockSize = 10,
01091            eDefaultElementAllocatorBlockSize = 10,
01092            eDefaultElementNSAllocatorBlockSize = 10,
01093            eDefaultPIAllocatorBlockSize = 10,
01094            eDefaultTextAllocatorBlockSize = 20,
01095            eDefaultTextIWSAllocatorBlockSize = 20 };
01096 
01097     ElementRecursionStackType           m_elementRecursionStack;
01098 
01099     const PrefixResolver*               m_prefixResolver;
01100 
01101     const StylesheetRoot*               m_stylesheetRoot;
01102 
01103     FormatterListenerVectorType         m_formatterListeners;
01104 
01105     PrintWriterVectorType               m_printWriters;
01106 
01107     OutputStreamVectorType              m_outputStreams;
01108 
01109     CollationCompareFunctor*            m_collationCompareFunctor;
01110 
01114     VariablesStack                      m_variablesStack;
01115 
01116     ParamsVectorType                    m_paramsVector;
01117 
01118     XPathCacheMapType                   m_matchPatternCache;
01119 
01120     KeyTablesTableType                  m_keyTables;
01121 
01122     KeyDeclarationSetType               m_keyDeclarationSet;
01123 
01124     CountersTable                       m_countersTable;
01125 
01126     // If true, we will not check HTML output for elements with
01127     // namespaces.  This is an optimization which can lead to
01128     // non-conforming behavior.
01129     bool                                m_ignoreHTMLElementNamespaces;
01130 
01135     mutable XalanAutoPtr<XalanSourceTreeDocument>   m_sourceTreeResultTreeFactory;
01136 
01137     // Holds the current mode.
01138     const XalanQName*                   m_mode;
01139 
01140     const ElemTemplate*                 m_currentTemplate;
01141 
01142     typedef XalanObjectCacheDefault<FormatterToText>        FormatterToTextCacheType;
01143     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
01144     typedef XalanObjectCacheDefault<NodeSorter>             NodeSorterCacheType;
01145 
01146     FormatterToTextCacheType            m_formatterToTextCache;
01147 
01148     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
01149 
01150     NodeSorterCacheType                 m_nodeSorterCache;
01151 
01152     int                                 m_indentAmount;
01153 
01154     XResultTreeFragAllocator            m_xresultTreeFragAllocator;
01155 
01156     ResultTreeFragAllocator             m_resultTreeFragAllocator;
01157 
01158     XalanSourceTreeDocumentFragmentAllocator    m_documentFragmentAllocator;
01159 
01160     XalanSourceTreeDocumentAllocator    m_documentAllocator;
01161 
01162     // If true, we will use a separate document factory for
01163     // result tree fragments.
01164     bool                                m_usePerInstanceDocumentFactory;
01165 
01166     // If true, only text nodes will be cloned in the output...
01167     bool                                m_cloneTextNodesOnly;
01168 
01169     // Determines whether or not to override the property in the stylesheet.
01170     eEscapeURLs                         m_escapeURLs;
01171 
01172     // Determines whether or not to override the property in the stylesheet.
01173     eOmitMETATag                        m_omitMETATag;
01174 
01175     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
01176 
01177     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
01178 
01179     static const DefaultCollationCompareFunctor     s_defaultCollationFunctor;
01180 };
01181 
01182 
01183 
01184 #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++ XSLT Processor Version 1.4
Copyright © 2000, 2001, 2002 The Apache Software Foundation. All Rights Reserved.