## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.5

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