## Xalan-C++ API Documentation

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

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-2003 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/ResultTreeFrag.hpp>
    00100 #include <xalanc/XSLT/ResultTreeFragAllocator.hpp>
    00101 #include <xalanc/XSLT/Stylesheet.hpp>
    00102 #include <xalanc/XSLT/VariablesStack.hpp>
    00103 #include <xalanc/XSLT/XResultTreeFragAllocator.hpp>
    00104 #include <xalanc/XSLT/XalanSourceTreeDocumentAllocator.hpp>
    00105 #include <xalanc/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     virtual const XPath*
    00426     createMatchPattern(
    00427             const XalanDOMString&   str,
    00428             const PrefixResolver&   resolver);
    00429
    00430     virtual void
    00431     returnXPath(const XPath*    xpath);
    00432
    00433     virtual void
    00434     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
    00435
    00436     virtual const XObjectPtr
    00437     createVariable(
    00438             const XPath&                xpath,
    00439             XalanNode*                  contextNode,
    00440             const PrefixResolver&       resolver);
    00441
    00442     virtual const XObjectPtr
    00443     createVariable(
    00444             const ElemTemplateElement&  templateChild,
    00445             XalanNode*                  sourceNode);
    00446
    00447     virtual void
    00448     pushVariable(
    00449             const XalanQName&           name,
    00450             const ElemTemplateElement*  element,
    00451             const XalanDOMString&       str,
    00452             XalanNode*                  contextNode,
    00453             const PrefixResolver&       resolver);
    00454
    00455     virtual void
    00456     pushVariable(
    00457             const XalanQName&           name,
    00458             const XObjectPtr            val,
    00459             const ElemTemplateElement*  element);
    00460
    00461     virtual void
    00462     pushVariable(
    00463             const XalanQName&           name,
    00464             const ElemVariable*         var,
    00465             const ElemTemplateElement*  element);
    00466
    00467     virtual void
    00468     pushVariable(
    00469             const XalanQName&           name,
    00470             const ElemTemplateElement*  element,
    00471             const XPath&                xpath,
    00472             XalanNode*                  contextNode,
    00473             const PrefixResolver&       resolver);
    00474
    00475     virtual void
    00476     pushVariable(
    00477             const XalanQName&           name,
    00478             const ElemTemplateElement*  element,
    00479             const ElemTemplateElement&  templateChild,
    00480             XalanNode*                  sourceNode);
    00481
    00482     virtual void
    00483     pushContextMarker();
    00484
    00485     virtual void
    00486     popContextMarker();
    00487
    00488     virtual void
    00489     resolveTopLevelParams();
    00490
    00491     virtual void
    00492     clearTopLevelParams();
    00493
    00494     virtual void
    00495     pushParams(
    00496             const ElemTemplateElement&  xslCallTemplateElement,
    00497             XalanNode*                  sourceNode,
    00498             const ElemTemplateElement*  targetTemplate);
    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(const ElemTemplateElement*  elem);
    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             eCaseOrder              theCaseOrder = eDefault);
    00720
    00721     virtual int
    00722     collationCompare(
    00723             const XalanDOMString&   theLHS,
    00724             const XalanDOMString&   theRHS,
    00725             const XalanDOMString&   theLocale,
    00726             eCaseOrder              theCaseOrder = eDefault);
    00727
    00728     virtual int
    00729     collationCompare(
    00730             const XalanDOMChar*     theLHS,
    00731             const XalanDOMChar*     theRHS,
    00732             eCaseOrder              theCaseOrder = eDefault);
    00733
    00734     virtual int
    00735     collationCompare(
    00736             const XalanDOMChar*     theLHS,
    00737             const XalanDOMChar*     theRHS,
    00738             const XalanDOMChar*     theLocale,
    00739             eCaseOrder              theCaseOrder = eDefault);
    00740
    00741     class XALAN_XSLT_EXPORT CollationCompareFunctor
    00742     {
    00743     public:
    00744
    00745         CollationCompareFunctor();
    00746
    00747         virtual
    00748         ~CollationCompareFunctor();
    00749
    00750         // Const version is suitable for use by
    00751         // multiple threads.
    00752         virtual int
    00753         operator()(
    00754             const XalanDOMChar*     theLHS,
    00755             const XalanDOMChar*     theRHS,
    00756             eCaseOrder              theCaseOrder = eDefault) const = 0;
    00757
    00758         // Const version is suitable for use by
    00759         // multiple threads.
    00760         virtual int
    00761         operator()(
    00762             const XalanDOMChar*     theLHS,
    00763             const XalanDOMChar*     theRHS,
    00764             const XalanDOMChar*     theLocale,
    00765             eCaseOrder              theCaseOrder = eDefault) const = 0;
    00766     };
    00767
    00768     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
    00769     {
    00770     public:
    00771
    00772         DefaultCollationCompareFunctor();
    00773
    00774         virtual
    00775         ~DefaultCollationCompareFunctor();
    00776
    00777         virtual int
    00778         operator()(
    00779             const XalanDOMChar*     theLHS,
    00780             const XalanDOMChar*     theRHS,
    00781             eCaseOrder              theCaseOrder = eDefault) const;
    00782
    00783         virtual int
    00784         operator()(
    00785             const XalanDOMChar*     theLHS,
    00786             const XalanDOMChar*     theRHS,
    00787             const XalanDOMChar*     theLocale,
    00788             eCaseOrder              theCaseOrder = eDefault) const;
    00789     };
    00790
    00791     const CollationCompareFunctor*
    00792     installCollationCompareFunctor(CollationCompareFunctor*     theFunctor);
    00793
    00794     CollationCompareFunctor*
    00795     uninstallCollationCompareFunctor();
    00796
    00797     virtual bool
    00798     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
    00799
    00800     virtual void
    00801     beginConstruction(const KeyDeclaration&     keyDeclaration);
    00802
    00803     virtual void
    00804     endConstruction(const KeyDeclaration&   keyDeclaration);
    00805
    00806     virtual const XalanDecimalFormatSymbols*
    00807     getDecimalFormatSymbols(const XalanQName&   qname);
    00808
    00809     virtual PrintWriter*
    00810     createPrintWriter(XalanOutputStream*        theTextOutputStream);
    00811
    00812     virtual PrintWriter*
    00813     createPrintWriter(
    00814             const XalanDOMString&       theFileName,
    00815             const XalanDOMString&       theEncoding);
    00816
    00817     virtual PrintWriter*
    00818     createPrintWriter(StreamType&   theStream);
    00819
    00820     virtual PrintWriter*
    00821     createPrintWriter(FILE*     theStream);
    00822
    00823     virtual CountersTable&
    00824     getCountersTable();
    00825
    00826     virtual void
    00827     characters(const XalanNode&     node);
    00828
    00829     virtual void
    00830     characters(const XObjectPtr&    xobject);
    00831
    00832     virtual void
    00833     charactersRaw(const XalanNode&  node);
    00834
    00835     virtual void
    00836     charactersRaw(const XObjectPtr&     xobject);
    00837
    00838
    00839     // These interfaces are inherited from XPathExecutionContext...
    00840
    00841     virtual void
    00842     reset();
    00843
    00844     virtual XalanNode*
    00845     getCurrentNode() const;
    00846
    00847     virtual void
    00848     setCurrentNode(XalanNode*   theCurrentNode);
    00849
    00850     virtual bool
    00851     isNodeAfter(
    00852             const XalanNode&    node1,
    00853             const XalanNode&    node2) const;
    00854
    00855     virtual const NodeRefListBase&
    00856     getContextNodeList() const;
    00857
    00858     virtual void
    00859     setContextNodeList(const NodeRefListBase&   theList);
    00860
    00861     virtual size_type
    00862     getContextNodeListLength() const;
    00863
    00864     virtual size_type
    00865     getContextNodeListPosition(const XalanNode&     contextNode) const;
    00866
    00867     virtual bool
    00868     elementAvailable(const XalanQName&  theQName) const;
    00869
    00870     virtual bool
    00871     elementAvailable(
    00872             const XalanDOMString&   theName,
    00873             const LocatorType*      locator) const;
    00874
    00875     virtual bool
    00876     functionAvailable(const XalanQName&     theQName) const;
    00877
    00878     virtual bool
    00879     functionAvailable(
    00880             const XalanDOMString&   theName,
    00881             const LocatorType*      locator) const;
    00882
    00883     virtual const XObjectPtr
    00884     extFunction(
    00885             const XalanDOMString&           theNamespace,
    00886             const XalanDOMString&           functionName,
    00887             XalanNode*                      context,
    00888             const XObjectArgVectorType&     argVec,
    00889             const LocatorType*              locator);
    00890
    00891     virtual XalanDocument*
    00892     parseXML(
    00893             const XalanDOMString&   urlString,
    00894             const XalanDOMString&   base) const;
    00895
    00896     virtual MutableNodeRefList*
    00897     borrowMutableNodeRefList();
    00898
    00899     virtual bool
    00900     returnMutableNodeRefList(MutableNodeRefList*    theList);
    00901
    00902     virtual MutableNodeRefList*
    00903     createMutableNodeRefList() const;
    00904
    00905     virtual XalanDOMString&
    00906     getCachedString();
    00907
    00908     virtual bool
    00909     releaseCachedString(XalanDOMString&     theString);
    00910
    00911     virtual void
    00912     getNodeSetByKey(
    00913             XalanDocument*          doc,
    00914             const XalanQName&       qname,
    00915             const XalanDOMString&   ref,
    00916             MutableNodeRefList&     nodelist);
    00917
    00918     virtual void
    00919     getNodeSetByKey(
    00920             XalanDocument*          doc,
    00921             const XalanDOMString&   name,
    00922             const XalanDOMString&   ref,
    00923             const LocatorType*      locator,
    00924             MutableNodeRefList&     nodelist);
    00925
    00926     virtual const XObjectPtr
    00927     getVariable(
    00928             const XalanQName&   name,
    00929             const LocatorType*  locator = 0);
    00930
    00931     virtual const PrefixResolver*
    00932     getPrefixResolver() const;
    00933
    00934     virtual void
    00935     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
    00936
    00937     virtual const XalanDOMString*
    00938     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
    00939
    00940     virtual XalanDOMString
    00941     findURIFromDoc(const XalanDocument*     owner) const;
    00942
    00943     virtual const XalanDOMString&
    00944     getUnparsedEntityURI(
    00945             const XalanDOMString&   theName,
    00946             const XalanDocument&    theDocument) const;
    00947
    00948     virtual bool
    00949     shouldStripSourceNode(const XalanNode&  node);
    00950
    00951     virtual bool
    00952     getThrowFoundIndex() const;
    00953
    00954     virtual void
    00955     setThrowFoundIndex(bool     fThrow);
    00956
    00957     virtual XalanDocument*
    00958     getSourceDocument(const XalanDOMString&     theURI) const;
    00959
    00960     virtual void
    00961     setSourceDocument(
    00962             const XalanDOMString&   theURI,
    00963             XalanDocument*          theDocument);
    00964
    00965
    00966     // These interfaces are inherited from ExecutionContext...
    00967
    00968     virtual void
    00969     error(
    00970             const XalanDOMString&   msg,
    00971             const XalanNode*        sourceNode,
    00972             const LocatorType*      locator) const;
    00973
    00974     virtual void
    00975     error(
    00976             const char*         msg,
    00977             const XalanNode*    sourceNode,
    00978             const LocatorType*  locator) const;
    00979
    00980     virtual void
    00981     warn(
    00982             const XalanDOMString&   msg,
    00983             const XalanNode*        sourceNode,
    00984             const LocatorType*      locator) const;
    00985
    00986     virtual void
    00987     warn(
    00988             const char*         msg,
    00989             const XalanNode*    sourceNode,
    00990             const LocatorType*  locator) const;
    00991
    00992     virtual void
    00993     message(
    00994             const XalanDOMString&   msg,
    00995             const XalanNode*    sourceNode,
    00996             const LocatorType*  locator) const;
    00997
    00998     virtual void
    00999     message(
    01000             const char*         msg,
    01001             const XalanNode*    sourceNode,
    01002             const LocatorType*  locator) const;
    01003
    01004
    01005     class XPathCacheReturnFunctor
    01006     {
    01007     public:
    01008
    01009         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
    01010             m_xsltProcessor(xsltProcessor)
    01011         {
    01012         }
    01013
    01014         void
    01015         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
    01016
    01017     private:
    01018
    01019         XSLTEngineImpl&     m_xsltProcessor;
    01020     };
    01021
    01026     XalanSourceTreeDocument*
    01027     getSourceTreeFactory() const;
    01028
    01029 protected:
    01030
    01031     virtual FormatterToText*
    01032     borrowFormatterToText();
    01033
    01034     virtual bool
    01035     returnFormatterToText(FormatterToText*  theFormatter);
    01036
    01037 private:
    01038
    01047     void
    01048     getParams(
    01049             const ElemTemplateElement&  xslCallTemplateElement,
    01050             XalanNode*                  sourceNode,
    01051             ParamsVectorType&           params);
    01052
    01059     bool
    01060     isCached(const XPath*   theXPath);
    01061
    01065     void
    01066     clearXPathCache();
    01067
    01075     void
    01076     addToXPathCache(
    01077             const XalanDOMString&   pattern,
    01078             const XPath*            theXPath);
    01079
    01080
    01084     void
    01085     cleanUpTransients();
    01086
    01087     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
    01088
    01089     XSLTEngineImpl*                 m_xsltProcessor;
    01090
    01091     XalanNode*                      m_rootDocument;
    01092
    01093     enum { eXPathCacheMax = 50,
    01094            eDefaultParamsVectorSize = 10,
    01095            eXResultTreeFragAllocatorBlockSize = 10,
    01096            eResultTreeFragAllocatorBlockSize = 10,
    01097            eDocumentAllocatorBlockSize = 10,
    01098            eDocumentFragmentAllocatorBlockSize = 10,
    01099            eDefaultAttributeAllocatorBlockSize = 10,
    01100            eDefaultAttributeNSAllocatorBlockSize = 10,
    01101            eDefaultCommentAllocatorBlockSize = 10,
    01102            eDefaultElementAllocatorBlockSize = 10,
    01103            eDefaultElementNSAllocatorBlockSize = 10,
    01104            eDefaultPIAllocatorBlockSize = 10,
    01105            eDefaultTextAllocatorBlockSize = 20,
    01106            eDefaultTextIWSAllocatorBlockSize = 20 };
    01107
    01108     ElementRecursionStackType           m_elementRecursionStack;
    01109
    01110     const PrefixResolver*               m_prefixResolver;
    01111
    01112     const StylesheetRoot*               m_stylesheetRoot;
    01113
    01114     FormatterListenerVectorType         m_formatterListeners;
    01115
    01116     PrintWriterVectorType               m_printWriters;
    01117
    01118     OutputStreamVectorType              m_outputStreams;
    01119
    01120     CollationCompareFunctor*            m_collationCompareFunctor;
    01121
    01125     VariablesStack                      m_variablesStack;
    01126
    01127     ParamsVectorType                    m_paramsVector;
    01128
    01129     XPathCacheMapType                   m_matchPatternCache;
    01130
    01131     KeyTablesTableType                  m_keyTables;
    01132
    01133     KeyDeclarationSetType               m_keyDeclarationSet;
    01134
    01135     CountersTable                       m_countersTable;
    01136
    01137     // If true, we will not check HTML output for elements with
    01138     // namespaces.  This is an optimization which can lead to
    01139     // non-conforming behavior.
    01140     bool                                m_ignoreHTMLElementNamespaces;
    01141
    01146     mutable XalanAutoPtr<XalanSourceTreeDocument>   m_sourceTreeResultTreeFactory;
    01147
    01148     // Holds the current mode.
    01149     const XalanQName*                   m_mode;
    01150
    01151     const ElemTemplate*                 m_currentTemplate;
    01152
    01153     typedef XalanObjectCacheDefault<FormatterToText>        FormatterToTextCacheType;
    01154     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
    01155     typedef XalanObjectCacheDefault<NodeSorter>             NodeSorterCacheType;
    01156
    01157     FormatterToTextCacheType            m_formatterToTextCache;
    01158
    01159     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
    01160
    01161     NodeSorterCacheType                 m_nodeSorterCache;
    01162
    01163     int                                 m_indentAmount;
    01164
    01165     XResultTreeFragAllocator            m_xresultTreeFragAllocator;
    01166
    01167     ResultTreeFragAllocator             m_resultTreeFragAllocator;
    01168
    01169     XalanSourceTreeDocumentFragmentAllocator    m_documentFragmentAllocator;
    01170
    01171     XalanSourceTreeDocumentAllocator    m_documentAllocator;
    01172
    01173     // If true, we will use a separate document factory for
    01174     // result tree fragments.
    01175     bool                                m_usePerInstanceDocumentFactory;
    01176
    01177     // If true, only text nodes will be cloned in the output...
    01178     bool                                m_cloneTextNodesOnly;
    01179
    01180     // Determines whether or not to override the property in the stylesheet.
    01181     eEscapeURLs                         m_escapeURLs;
    01182
    01183     // Determines whether or not to override the property in the stylesheet.
    01184     eOmitMETATag                        m_omitMETATag;
    01185
    01186     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
    01187
    01188     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
    01189
    01190     static const DefaultCollationCompareFunctor     s_defaultCollationFunctor;
    01191 };
    01192
    01193
    01194
    01195 XALAN_CPP_NAMESPACE_END
    01196
    01197
    01198
    01199 #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.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.