## Xalan-C++ API Documentation

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

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-2004 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 <xalanc/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 <xalanc/Include/XalanObjectCache.hpp>
    00078
    00079
    00080
    00081 #include <xalanc/XPath/XPathExecutionContextDefault.hpp>
    00082
    00083
    00084
    00085 #include <xalanc/XMLSupport/FormatterToText.hpp>
    00086
    00087
    00088
    00089 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
    00090 #include <xalanc/XalanSourceTree/XalanSourceTreeDocument.hpp>
    00091 #endif
    00092 #include <xalanc/XalanSourceTree/FormatterToSourceTree.hpp>
    00093 #include <xalanc/XalanSourceTree/XalanSourceTreeDocumentFragment.hpp>
    00094
    00095
    00096
    00097 #include <xalanc/XSLT/CountersTable.hpp>
    00098 #include <xalanc/XSLT/NodeSorter.hpp>
    00099 #include <xalanc/XSLT/Stylesheet.hpp>
    00100 #include <xalanc/XSLT/VariablesStack.hpp>
    00101 #include <xalanc/XSLT/XResultTreeFragAllocator.hpp>
    00102 #include <xalanc/XSLT/XalanSourceTreeDocumentAllocator.hpp>
    00103 #include <xalanc/XSLT/XalanSourceTreeDocumentFragmentAllocator.hpp>
    00104
    00105
    00106
    00107 XALAN_CPP_NAMESPACE_BEGIN
    00108
    00109
    00110
    00111 class XalanSourceTreeDocument;
    00112 class XPathProcessor;
    00113 class XSLTEngineImpl;
    00114
    00115
    00116
    00117 //
    00118 // An class which provides support for executing stylesheets.
    00119 //
    00120 class XALAN_XSLT_EXPORT StylesheetExecutionContextDefault : public StylesheetExecutionContext
    00121 {
    00122 public:
    00123
    00124 #if defined(XALAN_STRICT_ANSI_HEADERS)
    00125     typedef std::clock_t    ClockType;
    00126 #else
    00127     typedef clock_t         ClockType;
    00128 #endif
    00129
    00130 #if defined(XALAN_NO_STD_NAMESPACE)
    00131     typedef deque<const ElemTemplateElement*>           ElementTemplateElementStackType;
    00132     typedef vector<FormatterListener*>                  FormatterListenerVectorType;
    00133     typedef vector<PrintWriter*>                        PrintWriterVectorType;
    00134     typedef vector<XalanOutputStream*>                  OutputStreamVectorType;
    00135     typedef set<const KeyDeclaration*,
    00136                 less<const KeyDeclaration*> >           KeyDeclarationSetType;
    00137     typedef pair<const XPath*, ClockType>               XPathCacheEntry;
    00138     typedef map<XalanDOMString,
    00139                 XPathCacheEntry,
    00140                 less<XalanDOMString> >                  XPathCacheMapType;
    00141     typedef deque<const ElemTemplate*>                  CurrentTemplateStackType;
    00142 #else
    00143     typedef std::deque<const ElemTemplateElement*>      ElementTemplateElementStackType;
    00144     typedef std::vector<FormatterListener*>             FormatterListenerVectorType;
    00145     typedef std::vector<PrintWriter*>                   PrintWriterVectorType;
    00146     typedef std::vector<XalanOutputStream*>             OutputStreamVectorType;
    00147     typedef std::set<const KeyDeclaration*>             KeyDeclarationSetType;
    00148     typedef std::pair<const XPath*, ClockType>          XPathCacheEntry;
    00149     typedef std::map<XalanDOMString, XPathCacheEntry>   XPathCacheMapType;
    00150     typedef std::deque<const ElemTemplate*>             CurrentTemplateStackType;
    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     pushCurrentTemplate(const ElemTemplate* theTemplate);
    00355
    00356     virtual void
    00357     popCurrentTemplate();
    00358
    00359     virtual bool
    00360     doDiagnosticsOutput() const;
    00361
    00362     virtual void
    00363     diag(const XalanDOMString&  theString);
    00364
    00365     virtual void
    00366     pushTime(const void*    theKey);
    00367
    00368     virtual void
    00369     displayDuration(
    00370             const XalanDOMString&   theMessage,
    00371             const void*             theKey);
    00372
    00373     virtual bool
    00374     isElementPending() const;
    00375
    00376     virtual void
    00377     replacePendingAttribute(
    00378             const XalanDOMChar*     theName,
    00379             const XalanDOMChar*     theNewType,
    00380             const XalanDOMChar*     theNewValue);
    00381
    00382     virtual void
    00383     pushOutputContext(FormatterListener*    flistener = 0);
    00384
    00385     virtual void
    00386     popOutputContext();
    00387
    00388     virtual void
    00389     addResultAttribute(
    00390             const XalanDOMString&   aname,
    00391             const XalanDOMString&   value);
    00392
    00393     virtual void
    00394     addResultAttribute(
    00395             const XalanDOMString&   aname,
    00396             const XalanDOMChar*     value);
    00397
    00398     virtual void
    00399     copyNamespaceAttributes(const XalanNode&    src);
    00400
    00401     virtual const XalanDOMString*
    00402     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const;
    00403
    00404     virtual const XalanDOMString*
    00405     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const;
    00406
    00407     virtual bool
    00408     isPendingResultPrefix(const XalanDOMString& thePrefix);
    00409
    00410     virtual XalanDOMString
    00411     getUniqueNamespaceValue() const;
    00412
    00413     virtual void
    00414     getUniqueNamespaceValue(XalanDOMString&     theValue) const;
    00415
    00416     virtual FormatterListener*
    00417     getFormatterListener() const;
    00418
    00419     virtual void
    00420     setFormatterListener(FormatterListener*     flistener);
    00421
    00422     virtual int
    00423     getIndent() const;
    00424
    00425     virtual void
    00426     setIndent(int   indentAmount);
    00427
    00428     virtual const XPath*
    00429     createMatchPattern(
    00430             const XalanDOMString&   str,
    00431             const PrefixResolver&   resolver);
    00432
    00433     virtual void
    00434     returnXPath(const XPath*    xpath);
    00435
    00436     virtual void
    00437     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
    00438
    00439     virtual const XObjectPtr
    00440     createVariable(
    00441             const XPath&                xpath,
    00442             XalanNode*                  contextNode,
    00443             const PrefixResolver&       resolver);
    00444
    00445     virtual const XObjectPtr
    00446     createVariable(
    00447             const ElemTemplateElement&  templateChild,
    00448             XalanNode*                  sourceNode);
    00449
    00450     virtual void
    00451     pushVariable(
    00452             const XalanQName&           name,
    00453             const ElemTemplateElement*  element,
    00454             const XalanDOMString&       str,
    00455             XalanNode*                  contextNode,
    00456             const PrefixResolver&       resolver);
    00457
    00458     virtual void
    00459     pushVariable(
    00460             const XalanQName&           name,
    00461             const XObjectPtr            val,
    00462             const ElemTemplateElement*  element);
    00463
    00464     virtual void
    00465     pushVariable(
    00466             const XalanQName&           name,
    00467             const ElemVariable*         var,
    00468             const ElemTemplateElement*  element);
    00469
    00470     virtual void
    00471     pushVariable(
    00472             const XalanQName&           name,
    00473             const ElemTemplateElement*  element,
    00474             const XPath&                xpath,
    00475             XalanNode*                  contextNode,
    00476             const PrefixResolver&       resolver);
    00477
    00478     virtual void
    00479     pushVariable(
    00480             const XalanQName&           name,
    00481             const ElemTemplateElement*  element,
    00482             const ElemTemplateElement&  templateChild,
    00483             XalanNode*                  sourceNode);
    00484
    00485     virtual void
    00486     pushContextMarker();
    00487
    00488     virtual void
    00489     popContextMarker();
    00490
    00491     virtual void
    00492     resolveTopLevelParams();
    00493
    00494     virtual void
    00495     clearTopLevelParams();
    00496
    00497     virtual void
    00498     pushParams(const ElemTemplateElement&   xslCallTemplateElement);
    00499
    00500     virtual const XObjectPtr
    00501     getParamVariable(const XalanQName&  theName);
    00502
    00503     virtual void
    00504     pushElementFrame(const ElemTemplateElement*     elem);
    00505
    00506     virtual void
    00507     popElementFrame();
    00508
    00509     virtual int
    00510     getGlobalStackFrameIndex() const;
    00511
    00512     virtual int
    00513     getCurrentStackFrameIndex() const;
    00514
    00515     virtual void
    00516     setCurrentStackFrameIndex(int currentStackFrameIndex = -1);
    00517
    00518     virtual void
    00519     startDocument();
    00520
    00521     virtual void
    00522     endDocument();
    00523
    00524     virtual void
    00525     startElement(const XalanDOMChar*    name);
    00526
    00527     virtual void
    00528     endElement(const XalanDOMChar*  name);
    00529
    00530     virtual void
    00531     characters(
    00532             const XalanDOMChar*         ch,
    00533             XalanDOMString::size_type   start,
    00534             XalanDOMString::size_type   length);
    00535
    00536     virtual void
    00537     charactersRaw(
    00538             const XalanDOMChar*         ch,
    00539             XalanDOMString::size_type   start,
    00540             XalanDOMString::size_type   length);
    00541
    00542     virtual void
    00543     comment(const XalanDOMChar*     data);
    00544
    00545     virtual void
    00546     processingInstruction(
    00547             const XalanDOMChar*     target,
    00548             const XalanDOMChar*     data);
    00549
    00550     virtual void
    00551     flushPending();
    00552
    00553     virtual void
    00554     cloneToResultTree(
    00555             const XalanNode&    node,
    00556             const LocatorType*  locator);
    00557
    00558     virtual void
    00559     cloneToResultTree(
    00560             const XalanNode&        node,
    00561             XalanNode::NodeType     nodeType,
    00562             bool                    isLiteral,
    00563             bool                    overrideStrip,
    00564             bool                    shouldCloneAttributes,
    00565             const LocatorType*      locator);
    00566
    00567     virtual const XObjectPtr
    00568     createXResultTreeFrag(
    00569             const ElemTemplateElement&  templateChild,
    00570             XalanNode*                  sourceNode);
    00571
    00572     virtual void
    00573     outputToResultTree(
    00574             const XObject&      xobj,
    00575             const LocatorType*  locator);
    00576
    00577     virtual void
    00578     outputResultTreeFragment(
    00579             const XObject&      theTree,
    00580             const LocatorType*  locator);
    00581
    00582     virtual const XalanDOMString&
    00583     getXSLNameSpaceURL() const;
    00584
    00585     virtual const XalanDOMString&
    00586     getXalanXSLNameSpaceURL() const;
    00587
    00588     virtual bool
    00589     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const;
    00590
    00591     virtual void
    00592     pushOnElementRecursionStack(const ElemTemplateElement*  theElement);
    00593
    00594     virtual const ElemTemplateElement*
    00595     popElementRecursionStack();
    00596
    00597     virtual bool
    00598     returnXResultTreeFrag(XResultTreeFrag*  theXResultTreeFrag);
    00599
    00600     virtual eEscapeURLs
    00601     getEscapeURLs() const;
    00602
    00603     virtual void
    00604     setEscapeURLs(eEscapeURLs   value);
    00605
    00606     virtual eOmitMETATag
    00607     getOmitMETATag() const;
    00608
    00609     void
    00610     setOmitMETATag(eOmitMETATag     value);
    00611
    00612     virtual FormatterListener*
    00613     createFormatterToXML(
    00614             Writer&                 writer,
    00615             const XalanDOMString&   version = XalanDOMString(),
    00616             bool                    doIndent = false,
    00617             int                     indent = eDefaultXMLIndentAmount,
    00618             const XalanDOMString&   encoding = XalanDOMString(),
    00619             const XalanDOMString&   mediaType = XalanDOMString(),
    00620             const XalanDOMString&   doctypeSystem = XalanDOMString(),
    00621             const XalanDOMString&   doctypePublic = XalanDOMString(),
    00622             bool                    xmlDecl = true,
    00623             const XalanDOMString&   standalone = XalanDOMString());
    00624
    00625     virtual FormatterListener*
    00626     createFormatterToHTML(
    00627             Writer&                 writer,
    00628             const XalanDOMString&   encoding = XalanDOMString(),
    00629             const XalanDOMString&   mediaType = XalanDOMString(),
    00630             const XalanDOMString&   doctypeSystem = XalanDOMString(),
    00631             const XalanDOMString&   doctypePublic = XalanDOMString(),
    00632             bool                    doIndent = true,
    00633             int                     indent = eDefaultHTMLIndentAmount,
    00634             bool                    escapeURLs = true,
    00635             bool                    omitMetaTag = false);
    00636
    00637     virtual FormatterListener*
    00638     createFormatterToDOM(
    00639             XalanDocument*          doc,
    00640             XalanDocumentFragment*  docFrag,
    00641             XalanElement*           currentElement);
    00642
    00643     virtual FormatterListener*
    00644     createFormatterToDOM(
    00645             XalanDocument*  doc,
    00646             XalanElement*   elem);
    00647
    00648     virtual FormatterListener*
    00649     createFormatterToText(
    00650             Writer&                 writer,
    00651             const XalanDOMString&   encoding);
    00652
    00653     virtual NodeSorter*
    00654     borrowNodeSorter();
    00655
    00656     virtual bool
    00657     returnNodeSorter(NodeSorter*    theSorter);
    00658
    00659     virtual XalanNumberFormatAutoPtr
    00660     createXalanNumberFormat();
    00661
    00662     // A basic class to create XalanNumberFormat instances...
    00663     class XALAN_XSLT_EXPORT XalanNumberFormatFactory
    00664     {
    00665     public:
    00666
    00667         explicit
    00668         XalanNumberFormatFactory();
    00669
    00670         virtual
    00671         ~XalanNumberFormatFactory();
    00672
    00673         virtual XalanNumberFormat*
    00674         create();
    00675     };
    00676
    00677     static XalanNumberFormatFactory&
    00678     getDefaultXalanNumberFormatFactory()
    00679     {
    00680         return s_defaultXalanNumberFormatFactory;
    00681     }
    00682
    00690     static XalanNumberFormatFactory*
    00691     installXalanNumberFormatFactory(XalanNumberFormatFactory*   theFactory);
    00692
    00693
    00694     virtual size_type
    00695     getTraceListeners() const;
    00696
    00697     virtual void
    00698     fireGenerateEvent(const GenerateEvent&  ge);
    00699
    00700     virtual void
    00701     fireTraceEvent(const TracerEvent&   te);
    00702
    00703     virtual void
    00704     fireSelectEvent(const SelectionEvent&   se);
    00705
    00706     virtual bool
    00707     getTraceSelects() const;
    00708
    00709     virtual void
    00710     traceSelect(
    00711             const ElemTemplateElement&  theStylesheetElement,
    00712             const NodeRefListBase&      nl,
    00713             const XPath*                xpath);
    00714
    00715     virtual int
    00716     collationCompare(
    00717             const XalanDOMString&               theLHS,
    00718             const XalanDOMString&               theRHS,
    00719             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00720
    00721     virtual int
    00722     collationCompare(
    00723             const XalanDOMString&               theLHS,
    00724             const XalanDOMString&               theRHS,
    00725             const XalanDOMString&               theLocale,
    00726             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00727
    00728     virtual int
    00729     collationCompare(
    00730             const XalanDOMChar*                 theLHS,
    00731             const XalanDOMChar*                 theRHS,
    00732             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00733
    00734     virtual int
    00735     collationCompare(
    00736             const XalanDOMChar*                 theLHS,
    00737             const XalanDOMChar*                 theRHS,
    00738             const XalanDOMChar*                 theLocale,
    00739             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00740
    00741     typedef XalanCollationServices::CollationCompareFunctor     CollationCompareFunctor;
    00742
    00743     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
    00744     {
    00745     public:
    00746
    00747         DefaultCollationCompareFunctor();
    00748
    00749         virtual
    00750         ~DefaultCollationCompareFunctor();
    00751
    00752         virtual int
    00753         operator()(
    00754             const XalanDOMChar*                 theLHS,
    00755             const XalanDOMChar*                 theRHS,
    00756             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault) const;
    00757
    00758         virtual int
    00759         operator()(
    00760             const XalanDOMChar*                 theLHS,
    00761             const XalanDOMChar*                 theRHS,
    00762             const XalanDOMChar*                 theLocale,
    00763             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault) const;
    00764     };
    00765
    00766     const CollationCompareFunctor*
    00767     installCollationCompareFunctor(CollationCompareFunctor*     theFunctor);
    00768
    00769     CollationCompareFunctor*
    00770     uninstallCollationCompareFunctor();
    00771
    00772     virtual bool
    00773     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
    00774
    00775     virtual void
    00776     beginConstruction(const KeyDeclaration&     keyDeclaration);
    00777
    00778     virtual void
    00779     endConstruction(const KeyDeclaration&   keyDeclaration);
    00780
    00781     virtual const XalanDecimalFormatSymbols*
    00782     getDecimalFormatSymbols(const XalanQName&   qname);
    00783
    00784     virtual PrintWriter*
    00785     createPrintWriter(XalanOutputStream*        theTextOutputStream);
    00786
    00787     virtual PrintWriter*
    00788     createPrintWriter(
    00789             const XalanDOMString&       theFileName,
    00790             const XalanDOMString&       theEncoding);
    00791
    00792     virtual PrintWriter*
    00793     createPrintWriter(StreamType&   theStream);
    00794
    00795     virtual PrintWriter*
    00796     createPrintWriter(FILE*     theStream);
    00797
    00798     virtual CountersTable&
    00799     getCountersTable();
    00800
    00801     virtual void
    00802     characters(const XalanNode&     node);
    00803
    00804     virtual void
    00805     characters(const XObjectPtr&    xobject);
    00806
    00807     virtual void
    00808     charactersRaw(const XalanNode&  node);
    00809
    00810     virtual void
    00811     charactersRaw(const XObjectPtr&     xobject);
    00812
    00813
    00814     // These interfaces are inherited from XPathExecutionContext...
    00815
    00816     virtual void
    00817     reset();
    00818
    00819     virtual XalanNode*
    00820     getCurrentNode() const;
    00821
    00822     virtual void
    00823     pushCurrentNode(XalanNode*  theCurrentNode);
    00824
    00825     virtual void
    00826     popCurrentNode();
    00827
    00828     virtual bool
    00829     isNodeAfter(
    00830             const XalanNode&    node1,
    00831             const XalanNode&    node2) const;
    00832
    00833     virtual void
    00834     pushContextNodeList(const NodeRefListBase&  theList);
    00835
    00836     virtual void
    00837     popContextNodeList();
    00838
    00839     virtual const NodeRefListBase&
    00840     getContextNodeList() const;
    00841
    00842     virtual size_type
    00843     getContextNodeListLength() const;
    00844
    00845     virtual size_type
    00846     getContextNodeListPosition(const XalanNode&     contextNode) const;
    00847
    00848     virtual bool
    00849     elementAvailable(const XalanQName&  theQName) const;
    00850
    00851     virtual bool
    00852     elementAvailable(
    00853             const XalanDOMString&   theName,
    00854             const LocatorType*      locator) const;
    00855
    00856     virtual bool
    00857     functionAvailable(const XalanQName&     theQName) const;
    00858
    00859     virtual bool
    00860     functionAvailable(
    00861             const XalanDOMString&   theName,
    00862             const LocatorType*      locator) const;
    00863
    00864     virtual const XObjectPtr
    00865     extFunction(
    00866             const XalanDOMString&           theNamespace,
    00867             const XalanDOMString&           functionName,
    00868             XalanNode*                      context,
    00869             const XObjectArgVectorType&     argVec,
    00870             const LocatorType*              locator);
    00871
    00872     virtual XalanDocument*
    00873     parseXML(
    00874             const XalanDOMString&   urlString,
    00875             const XalanDOMString&   base) const;
    00876
    00877     virtual MutableNodeRefList*
    00878     borrowMutableNodeRefList();
    00879
    00880     virtual bool
    00881     returnMutableNodeRefList(MutableNodeRefList*    theList);
    00882
    00883     virtual MutableNodeRefList*
    00884     createMutableNodeRefList() const;
    00885
    00886     virtual XalanDOMString&
    00887     getCachedString();
    00888
    00889     virtual bool
    00890     releaseCachedString(XalanDOMString&     theString);
    00891
    00892     virtual void
    00893     getNodeSetByKey(
    00894             XalanDocument*          doc,
    00895             const XalanQName&       qname,
    00896             const XalanDOMString&   ref,
    00897             MutableNodeRefList&     nodelist);
    00898
    00899     virtual void
    00900     getNodeSetByKey(
    00901             XalanDocument*          doc,
    00902             const XalanDOMString&   name,
    00903             const XalanDOMString&   ref,
    00904             const LocatorType*      locator,
    00905             MutableNodeRefList&     nodelist);
    00906
    00907     virtual const XObjectPtr
    00908     getVariable(
    00909             const XalanQName&   name,
    00910             const LocatorType*  locator = 0);
    00911
    00912     virtual const PrefixResolver*
    00913     getPrefixResolver() const;
    00914
    00915     virtual void
    00916     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
    00917
    00918     virtual const XalanDOMString*
    00919     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
    00920
    00921     virtual XalanDOMString
    00922     findURIFromDoc(const XalanDocument*     owner) const;
    00923
    00924     virtual const XalanDOMString&
    00925     getUnparsedEntityURI(
    00926             const XalanDOMString&   theName,
    00927             const XalanDocument&    theDocument) const;
    00928
    00929     virtual bool
    00930     shouldStripSourceNode(const XalanNode&  node);
    00931
    00932     virtual XalanDocument*
    00933     getSourceDocument(const XalanDOMString&     theURI) const;
    00934
    00935     virtual void
    00936     setSourceDocument(
    00937             const XalanDOMString&   theURI,
    00938             XalanDocument*          theDocument);
    00939
    00940
    00941     // These interfaces are inherited from ExecutionContext...
    00942
    00943     virtual void
    00944     error(
    00945             const XalanDOMString&   msg,
    00946             const XalanNode*        sourceNode,
    00947             const LocatorType*      locator) const;
    00948
    00949     virtual void
    00950     error(
    00951             const char*         msg,
    00952             const XalanNode*    sourceNode,
    00953             const LocatorType*  locator) const;
    00954
    00955     virtual void
    00956     warn(
    00957             const XalanDOMString&   msg,
    00958             const XalanNode*        sourceNode,
    00959             const LocatorType*      locator) const;
    00960
    00961     virtual void
    00962     warn(
    00963             const char*         msg,
    00964             const XalanNode*    sourceNode,
    00965             const LocatorType*  locator) const;
    00966
    00967     virtual void
    00968     message(
    00969             const XalanDOMString&   msg,
    00970             const XalanNode*    sourceNode,
    00971             const LocatorType*  locator) const;
    00972
    00973     virtual void
    00974     message(
    00975             const char*         msg,
    00976             const XalanNode*    sourceNode,
    00977             const LocatorType*  locator) const;
    00978
    00979
    00980     class XPathCacheReturnFunctor
    00981     {
    00982     public:
    00983
    00984         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
    00985             m_xsltProcessor(xsltProcessor)
    00986         {
    00987         }
    00988
    00989         void
    00990         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
    00991
    00992     private:
    00993
    00994         XSLTEngineImpl&     m_xsltProcessor;
    00995     };
    00996
    01001     XalanSourceTreeDocument*
    01002     getSourceTreeFactory() const;
    01003
    01004 protected:
    01005
    01006     virtual FormatterToText*
    01007     borrowFormatterToText();
    01008
    01009     virtual bool
    01010     returnFormatterToText(FormatterToText*  theFormatter);
    01011
    01012 private:
    01013
    01021     void
    01022     getParams(
    01023             const ElemTemplateElement&  xslCallTemplateElement,
    01024             ParamsVectorType&           params);
    01025
    01032     bool
    01033     isCached(const XPath*   theXPath);
    01034
    01038     void
    01039     clearXPathCache();
    01040
    01048     void
    01049     addToXPathCache(
    01050             const XalanDOMString&   pattern,
    01051             const XPath*            theXPath);
    01052
    01053
    01057     void
    01058     cleanUpTransients();
    01059
    01060     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
    01061
    01062     XSLTEngineImpl*                 m_xsltProcessor;
    01063
    01064     XalanNode*                      m_rootDocument;
    01065
    01066     enum { eXPathCacheMax = 50,
    01067            eDefaultParamsVectorSize = 10,
    01068            eXResultTreeFragAllocatorBlockSize = 10,
    01069            eDocumentAllocatorBlockSize = 10,
    01070            eDocumentFragmentAllocatorBlockSize = 10,
    01071            eDefaultAttributeAllocatorBlockSize = 10,
    01072            eDefaultAttributeNSAllocatorBlockSize = 10,
    01073            eDefaultCommentAllocatorBlockSize = 10,
    01074            eDefaultElementAllocatorBlockSize = 10,
    01075            eDefaultElementNSAllocatorBlockSize = 10,
    01076            eDefaultPIAllocatorBlockSize = 10,
    01077            eDefaultTextAllocatorBlockSize = 20,
    01078            eDefaultTextIWSAllocatorBlockSize = 20 };
    01079
    01080     ElementTemplateElementStackType     m_elementRecursionStack;
    01081
    01082     const PrefixResolver*               m_prefixResolver;
    01083
    01084     const StylesheetRoot*               m_stylesheetRoot;
    01085
    01086     FormatterListenerVectorType         m_formatterListeners;
    01087
    01088     PrintWriterVectorType               m_printWriters;
    01089
    01090     OutputStreamVectorType              m_outputStreams;
    01091
    01092     CollationCompareFunctor*            m_collationCompareFunctor;
    01093
    01097     VariablesStack                      m_variablesStack;
    01098
    01099     ParamsVectorType                    m_paramsVector;
    01100
    01101     XPathCacheMapType                   m_matchPatternCache;
    01102
    01103     KeyTablesTableType                  m_keyTables;
    01104
    01105     KeyDeclarationSetType               m_keyDeclarationSet;
    01106
    01107     CountersTable                       m_countersTable;
    01108
    01109     // If true, we will not check HTML output for elements with
    01110     // namespaces.  This is an optimization which can lead to
    01111     // non-conforming behavior.
    01112     bool                                m_ignoreHTMLElementNamespaces;
    01113
    01118     mutable XalanAutoPtr<XalanSourceTreeDocument>   m_sourceTreeResultTreeFactory;
    01119
    01120     // Holds the current mode.
    01121     const XalanQName*                   m_mode;
    01122
    01123     CurrentTemplateStackType            m_currentTemplateStack;
    01124
    01125     typedef XalanObjectCacheDefault<FormatterToText>        FormatterToTextCacheType;
    01126     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
    01127     typedef XalanObjectCacheDefault<NodeSorter>             NodeSorterCacheType;
    01128
    01129     FormatterToTextCacheType            m_formatterToTextCache;
    01130
    01131     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
    01132
    01133     NodeSorterCacheType                 m_nodeSorterCache;
    01134
    01135     int                                 m_indentAmount;
    01136
    01137     XResultTreeFragAllocator            m_xresultTreeFragAllocator;
    01138
    01139     XalanSourceTreeDocumentFragmentAllocator    m_documentFragmentAllocator;
    01140
    01141     XalanSourceTreeDocumentAllocator    m_documentAllocator;
    01142
    01143     // If true, we will use a separate document factory for
    01144     // result tree fragments.
    01145     bool                                m_usePerInstanceDocumentFactory;
    01146
    01147     // If true, only text nodes will be cloned in the output...
    01148     bool                                m_cloneTextNodesOnly;
    01149
    01150     // Determines whether or not to override the property in the stylesheet.
    01151     eEscapeURLs                         m_escapeURLs;
    01152
    01153     // Determines whether or not to override the property in the stylesheet.
    01154     eOmitMETATag                        m_omitMETATag;
    01155
    01156     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
    01157
    01158     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
    01159
    01160     static const DefaultCollationCompareFunctor     s_defaultCollationFunctor;
    01161 };
    01162
    01163
    01164
    01165 XALAN_CPP_NAMESPACE_END
    01166
    01167
    01168
    01169 #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.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.