## Xalan-C++ API Documentation

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

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# StylesheetExecutionContextDefault.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *     http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016 #if !defined(STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
    00017 #define STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
    00018
    00019
    00020
    00021 // Base class include file.
    00022 #include <xalanc/XSLT/StylesheetExecutionContext.hpp>
    00023
    00024
    00025
    00026 #include <ctime>
    00027 #include <memory>
    00028
    00029
    00030
    00031 #include <xalanc/Include/XalanVector.hpp>
    00032 #include <xalanc/Include/XalanMap.hpp>
    00033 #include <xalanc/Include/XalanSet.hpp>
    00034 #include <xalanc/Include/XalanObjectCache.hpp>
    00035 #include <xalanc/Include/XalanObjectStackCache.hpp>
    00036
    00037
    00038 #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
    00039
    00040
    00041 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00042 #include <xalanc/PlatformSupport/DOMStringPrintWriter.hpp>
    00043 #endif
    00044
    00045
    00046
    00047 #include <xalanc/XPath/XPathExecutionContextDefault.hpp>
    00048
    00049
    00050
    00051 #include <xalanc/XMLSupport/FormatterToText.hpp>
    00052
    00053
    00054
    00055 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
    00056 #include <xalanc/XalanSourceTree/XalanSourceTreeDocument.hpp>
    00057 #endif
    00058 #include <xalanc/XalanSourceTree/FormatterToSourceTree.hpp>
    00059 #include <xalanc/XalanSourceTree/XalanSourceTreeDocumentFragment.hpp>
    00060
    00061
    00062
    00063 #include <xalanc/XSLT/CountersTable.hpp>
    00064 #include <xalanc/XSLT/NodeSorter.hpp>
    00065 #include <xalanc/XSLT/Stylesheet.hpp>
    00066 #include <xalanc/XSLT/VariablesStack.hpp>
    00067 #include <xalanc/XSLT/XResultTreeFragAllocator.hpp>
    00068 #include <xalanc/XSLT/XalanSourceTreeDocumentAllocator.hpp>
    00069 #include <xalanc/XSLT/XalanSourceTreeDocumentFragmentAllocator.hpp>
    00070
    00071
    00072
    00073 XALAN_CPP_NAMESPACE_BEGIN
    00074
    00075
    00076
    00077 class XalanSourceTreeDocument;
    00078 class XPathProcessor;
    00079 class XSLTEngineImpl;
    00080
    00081 typedef VariablesStack::ParamsVectorType            ParamsVectorTypeDecl;
    00082 XALAN_USES_MEMORY_MANAGER(ParamsVectorTypeDecl)
    00083 //
    00084 // An class which provides support for executing stylesheets.
    00085 //
    00086 class XALAN_XSLT_EXPORT StylesheetExecutionContextDefault : public StylesheetExecutionContext
    00087 {
    00088
    00089
    00090
    00091 public:
    00092
    00093 #if defined(XALAN_STRICT_ANSI_HEADERS)
    00094     typedef std::clock_t    ClockType;
    00095 #else
    00096     typedef clock_t         ClockType;
    00097 #endif
    00098
    00099     typedef XalanVector<FormatterListener*>             FormatterListenerVectorType;
    00100     typedef XalanVector<PrintWriter*>                   PrintWriterVectorType;
    00101     typedef XalanVector<XalanOutputStream*>             OutputStreamVectorType;
    00102
    00103     typedef XalanVector<const ElemTemplateElement*> ElementTemplateElementStackType;
    00104     typedef XalanSet<const KeyDeclaration*> KeyDeclarationSetType;
    00105     typedef XALAN_STD_QUALIFIER pair<const XPath*, ClockType>       XPathCacheEntry;
    00106     typedef XalanMap <XalanDOMString, XPathCacheEntry>              XPathCacheMapType;
    00107     typedef XalanVector<const ElemTemplate*>            CurrentTemplateStackType;
    00108
    00109     typedef Stylesheet::KeyTablesTableType              KeyTablesTableType;
    00110     typedef ParamsVectorTypeDecl                        ParamsVectorType;
    00111
    00122     StylesheetExecutionContextDefault(
    00123             MemoryManagerType&      theManager,
    00124             XSLTEngineImpl&         xsltProcessor,
    00125             XPathEnvSupport&        theXPathEnvSupport,
    00126             DOMSupport&             theDOMSupport,
    00127             XObjectFactory&         theXObjectFactory,
    00128             XalanNode*              theCurrentNode = 0,
    00129             const NodeRefListBase*  theContextNodeList = 0,
    00130             const PrefixResolver*   thePrefixResolver = 0);
    00131
    00142     explicit
    00143     StylesheetExecutionContextDefault(
    00144             MemoryManagerType&      theManager,
    00145             XalanNode*              theCurrentNode = 0,
    00146             const NodeRefListBase*  theContextNodeList = 0,
    00147             const PrefixResolver*   thePrefixResolver = 0);
    00148
    00149     static StylesheetExecutionContextDefault*
    00150     create(
    00151             MemoryManagerType&      theManager,
    00152             XalanNode*              theCurrentNode = 0,
    00153             const NodeRefListBase*  theContextNodeList = 0,
    00154             const PrefixResolver*   thePrefixResolver = 0);
    00155
    00156     virtual
    00157     ~StylesheetExecutionContextDefault();
    00158
    00159
    00165     void
    00166     setXPathEnvSupport(XPathEnvSupport*     theSupport)
    00167     {
    00168         m_xpathExecutionContextDefault.setXPathEnvSupport(theSupport);
    00169     }
    00170
    00176     void
    00177     setDOMSupport(DOMSupport*   theDOMSupport)
    00178     {
    00179         m_xpathExecutionContextDefault.setDOMSupport(theDOMSupport);
    00180     }
    00181
    00187     void
    00188     setXObjectFactory(XObjectFactory*   theXObjectFactory)
    00189     {
    00190         m_xpathExecutionContextDefault.setXObjectFactory(theXObjectFactory);
    00191
    00192         m_xobjectFactory = theXObjectFactory;
    00193     }
    00194
    00195
    00201     void
    00202     setXSLTProcessor(XSLTEngineImpl*    theProcessor)
    00203     {
    00204         m_xsltProcessor = theProcessor;
    00205     }
    00206
    00207     bool
    00208     getUsePerInstanceDocumentFactory() const
    00209     {
    00210         return m_usePerInstanceDocumentFactory;
    00211     }
    00212
    00213     void
    00214     setUsePerInstanceDocumentFactory(bool   fValue)
    00215     {
    00216         m_usePerInstanceDocumentFactory = fValue;
    00217     }
    00218
    00219
    00220     // These interfaces are inherited from StylesheetExecutionContext...
    00221
    00222     virtual void
    00223     error(
    00224             const XalanDOMString&       msg,
    00225             const ElemTemplateElement&  styleNode,
    00226             const XalanNode*            sourceNode = 0) const;
    00227
    00228     virtual void
    00229     warn(
    00230             const XalanDOMString&       msg,
    00231             const ElemTemplateElement&  styleNode,
    00232             const XalanNode*            sourceNode = 0) const;
    00233
    00234     virtual void
    00235     message(
    00236             const XalanDOMString&       msg,
    00237             const ElemTemplateElement&  styleNode,
    00238             const XalanNode*            sourceNode = 0) const;
    00239
    00240     virtual bool
    00241     getQuietConflictWarnings() const;
    00242
    00243     virtual bool
    00244     getCopyTextNodesOnly() const;
    00245
    00246     virtual void
    00247     pushCopyTextNodesOnly(bool copyTextNodesOnly);
    00248
    00249     virtual bool
    00250     popCopyTextNodesOnly();
    00251
    00252 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00253     virtual void
    00254     pushProcessCurrentAttribute(bool processAttribute);
    00255
    00256     virtual bool
    00257     popProcessCurrentAttribute();
    00258
    00259     virtual void
    00260     pushSkipElementAttributes(bool skipAttributes);
    00261
    00262     virtual bool
    00263     getSkipElementAttributes() const;
    00264
    00265     virtual bool
    00266     popSkipElementAttributes();
    00267
    00268     virtual void
    00269     pushExecuteIf(bool executeIf);
    00270
    00271     virtual bool
    00272     popExecuteIf();
    00273 #endif
    00274
    00275     virtual XalanNode*
    00276     getRootDocument() const;
    00277
    00278     virtual void
    00279     setRootDocument(XalanNode*  theDocument);
    00280
    00281     virtual void
    00282     setStylesheetRoot(const StylesheetRoot*     theStylesheet);
    00283
    00284     virtual const XalanQName*
    00285     getCurrentMode() const;
    00286
    00287     virtual void
    00288     pushCurrentMode(const XalanQName*   theMode);
    00289
    00290     virtual void
    00291     popCurrentMode();
    00292
    00293     virtual const ElemTemplate*
    00294     getCurrentTemplate() const;
    00295
    00296     virtual void
    00297     pushCurrentTemplate(const ElemTemplate* theTemplate);
    00298
    00299     virtual void
    00300     popCurrentTemplate();
    00301
    00302     virtual bool
    00303     doDiagnosticsOutput() const;
    00304
    00305     virtual void
    00306     diag(const XalanDOMString&  theString);
    00307
    00308     virtual void
    00309     pushTime(const void*    theKey);
    00310
    00311     virtual void
    00312     displayDuration(
    00313             const XalanDOMString&   theMessage,
    00314             const void*             theKey);
    00315
    00316     virtual bool
    00317     isElementPending() const;
    00318
    00319     virtual void
    00320     replacePendingAttribute(
    00321             const XalanDOMChar*     theName,
    00322             const XalanDOMChar*     theNewType,
    00323             const XalanDOMChar*     theNewValue);
    00324
    00325     virtual void
    00326     pushOutputContext(FormatterListener*    flistener = 0);
    00327
    00328     virtual void
    00329     popOutputContext();
    00330
    00331     virtual void
    00332     addResultAttribute(
    00333             const XalanDOMString&   aname,
    00334             const XalanDOMString&   value);
    00335
    00336     virtual void
    00337     addResultAttribute(
    00338             const XalanDOMString&   aname,
    00339             const XalanDOMChar*     value);
    00340
    00341     virtual void
    00342     copyNamespaceAttributes(const XalanNode&    src);
    00343
    00344     virtual const XalanDOMString*
    00345     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const;
    00346
    00347     virtual const XalanDOMString*
    00348     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const;
    00349
    00350     virtual bool
    00351     isPendingResultPrefix(const XalanDOMString& thePrefix);
    00352
    00353     virtual void
    00354     getUniqueNamespaceValue(XalanDOMString&     theValue) const;
    00355
    00356     virtual FormatterListener*
    00357     getFormatterListener() const;
    00358
    00359     virtual void
    00360     setFormatterListener(FormatterListener*     flistener);
    00361
    00362     virtual int
    00363     getIndent() const;
    00364
    00365     virtual void
    00366     setIndent(int   indentAmount);
    00367
    00368     virtual const XPath*
    00369     createMatchPattern(
    00370             const XalanDOMString&   str,
    00371             const PrefixResolver&   resolver);
    00372
    00373     virtual void
    00374     returnXPath(const XPath*    xpath);
    00375
    00376     virtual void
    00377     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
    00378
    00379
    00380     virtual const XObjectPtr
    00381     createVariable(
    00382             const XPath&                xpath,
    00383             XalanNode*                  contextNode,
    00384             const PrefixResolver&       resolver);
    00385
    00386 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00387     virtual const XObjectPtr
    00388     createVariable(
    00389             const ElemTemplateElement&  templateChild,
    00390             XalanNode*                  sourceNode);
    00391 #endif
    00392
    00393     virtual void
    00394     pushVariable(
    00395             const XalanQName&           name,
    00396             const ElemTemplateElement*  element,
    00397             const XalanDOMString&       str,
    00398             XalanNode*                  contextNode,
    00399             const PrefixResolver&       resolver);
    00400
    00401     virtual void
    00402     pushVariable(
    00403             const XalanQName&           name,
    00404             const XObjectPtr            val,
    00405             const ElemTemplateElement*  element);
    00406
    00407     virtual void
    00408     pushVariable(
    00409             const XalanQName&           name,
    00410             const ElemVariable*         var,
    00411             const ElemTemplateElement*  element);
    00412
    00413     virtual void
    00414     pushVariable(
    00415             const XalanQName&           name,
    00416             const ElemTemplateElement*  element,
    00417             const XPath&                xpath,
    00418             XalanNode*                  contextNode,
    00419             const PrefixResolver&       resolver);
    00420
    00421 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00422     virtual void
    00423     pushVariable(
    00424             const XalanQName&           name,
    00425             const ElemTemplateElement*  element,
    00426             const ElemTemplateElement&  templateChild,
    00427             XalanNode*                  sourceNode);
    00428 #endif
    00429
    00430
    00431     virtual void
    00432     pushContextMarker();
    00433
    00434     virtual void
    00435     popContextMarker();
    00436
    00437     virtual void
    00438     resolveTopLevelParams();
    00439
    00440     virtual void
    00441     clearTopLevelParams();
    00442
    00443 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00444     virtual void beginParams();
    00445
    00446     virtual void endParams();
    00447
    00448     virtual void pushParam(const XalanQName& qName,const XObjectPtr& theValue);
    00449 #else
    00450     virtual void
    00451     pushParams(const ElemTemplateElement&   xslCallTemplateElement);
    00452 #endif
    00453
    00454     virtual const XObjectPtr
    00455     getParamVariable(const XalanQName&  theName);
    00456
    00457     virtual void
    00458     pushElementFrame(const ElemTemplateElement*     elem);
    00459
    00460     virtual void
    00461     popElementFrame();
    00462
    00463     virtual int
    00464     getGlobalStackFrameIndex() const;
    00465
    00466     virtual int
    00467     getCurrentStackFrameIndex() const;
    00468
    00469     virtual void
    00470     pushCurrentStackFrameIndex(int currentStackFrameIndex = -1);
    00471
    00472     virtual void
    00473     popCurrentStackFrameIndex();
    00474
    00475     virtual void
    00476     startDocument();
    00477
    00478     virtual void
    00479     endDocument();
    00480
    00481     virtual void
    00482     startElement(const XalanDOMChar*    name);
    00483
    00484     virtual void
    00485     endElement(const XalanDOMChar*  name);
    00486
    00487     virtual void
    00488     characters(
    00489             const XalanDOMChar*         ch,
    00490             XalanDOMString::size_type   start,
    00491             XalanDOMString::size_type   length);
    00492
    00493     virtual void
    00494     charactersRaw(
    00495             const XalanDOMChar*         ch,
    00496             XalanDOMString::size_type   start,
    00497             XalanDOMString::size_type   length);
    00498
    00499     virtual void
    00500     comment(const XalanDOMChar*     data);
    00501
    00502     virtual void
    00503     processingInstruction(
    00504             const XalanDOMChar*     target,
    00505             const XalanDOMChar*     data);
    00506
    00507     virtual void
    00508     flushPending();
    00509
    00510     virtual void
    00511     cloneToResultTree(
    00512             const XalanNode&    node,
    00513             const LocatorType*  locator);
    00514
    00515     virtual void
    00516     cloneToResultTree(
    00517             const XalanNode&        node,
    00518             XalanNode::NodeType     nodeType,
    00519             bool                    overrideStrip,
    00520             bool                    shouldCloneAttributes,
    00521             const LocatorType*      locator);
    00522
    00523 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00524     virtual void
    00525     beginCreateXResultTreeFrag(
    00526             XalanNode*                  sourceNode);
    00527
    00528
    00529     virtual const XObjectPtr
    00530     endCreateXResultTreeFrag();
    00531
    00532     virtual void
    00533     beginFormatToText(
    00534             XalanDOMString&             theResult);
    00535
    00536     virtual void
    00537     endFormatToText();
    00538 #endif
    00539
    00540
    00541 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00542     virtual const XObjectPtr
    00543     createXResultTreeFrag(
    00544             const ElemTemplateElement&  templateChild,
    00545             XalanNode*                  sourceNode);
    00546 #endif
    00547
    00548     virtual void
    00549     outputToResultTree(
    00550             const XObject&      xobj,
    00551             const LocatorType*  locator);
    00552
    00553     virtual void
    00554     outputResultTreeFragment(
    00555             const XObject&      theTree,
    00556             const LocatorType*  locator);
    00557
    00558     virtual const XalanDOMString&
    00559     getXSLNameSpaceURL() const;
    00560
    00561     virtual const XalanDOMString&
    00562     getXalanXSLNameSpaceURL() const;
    00563
    00564     virtual bool
    00565     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const;
    00566
    00567     virtual void
    00568     pushOnElementRecursionStack(const ElemTemplateElement*  theElement);
    00569
    00570     virtual const ElemTemplateElement*
    00571     popElementRecursionStack();
    00572
    00573     virtual bool
    00574     returnXResultTreeFrag(XResultTreeFrag*  theXResultTreeFrag);
    00575
    00576     virtual eEscapeURLs
    00577     getEscapeURLs() const;
    00578
    00579     virtual void
    00580     setEscapeURLs(eEscapeURLs   value);
    00581
    00582     virtual eOmitMETATag
    00583     getOmitMETATag() const;
    00584
    00585     void
    00586     setOmitMETATag(eOmitMETATag     value);
    00587
    00588     virtual FormatterListener*
    00589     createFormatterToXML(
    00590             Writer&                 writer,
    00591             const XalanDOMString&   version = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00592             bool                    doIndent = false,
    00593             int                     indent = eDefaultXMLIndentAmount,
    00594             const XalanDOMString&   encoding = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00595             const XalanDOMString&   mediaType = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00596             const XalanDOMString&   doctypeSystem = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00597             const XalanDOMString&   doctypePublic = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00598             bool                    xmlDecl = true,
    00599             const XalanDOMString&   standalone = XalanDOMString(XalanMemMgrs::getDummyMemMgr()));
    00600
    00601     virtual FormatterListener*
    00602     createFormatterToHTML(
    00603             Writer&                 writer,
    00604             const XalanDOMString&   encoding = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00605             const XalanDOMString&   mediaType = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00606             const XalanDOMString&   doctypeSystem = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00607             const XalanDOMString&   doctypePublic = XalanDOMString(XalanMemMgrs::getDummyMemMgr()),
    00608             bool                    doIndent = true,
    00609             int                     indent = eDefaultHTMLIndentAmount,
    00610             bool                    escapeURLs = true,
    00611             bool                    omitMetaTag = false);
    00612
    00613     virtual FormatterListener*
    00614     createFormatterToText(
    00615             Writer&                 writer,
    00616             const XalanDOMString&   encoding);
    00617
    00618 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00619     virtual NodeSorter*
    00620     getNodeSorter();
    00621 #else
    00622     virtual NodeSorter*
    00623     borrowNodeSorter();
    00624
    00625     virtual bool
    00626     returnNodeSorter(NodeSorter*    theSorter);
    00627 #endif
    00628
    00629     virtual XalanNumberFormatAutoPtr
    00630     createXalanNumberFormat();
    00631
    00632     // A basic class to create XalanNumberFormat instances...
    00633     class XALAN_XSLT_EXPORT XalanNumberFormatFactory
    00634     {
    00635     public:
    00636
    00637         explicit
    00638         XalanNumberFormatFactory();
    00639
    00640         virtual
    00641         ~XalanNumberFormatFactory();
    00642
    00643         virtual XalanNumberFormat*
    00644         create(MemoryManagerType& theManager);
    00645     };
    00646
    00647     static XalanNumberFormatFactory&
    00648     getDefaultXalanNumberFormatFactory()
    00649     {
    00650         return s_defaultXalanNumberFormatFactory;
    00651     }
    00652
    00660     static XalanNumberFormatFactory*
    00661     installXalanNumberFormatFactory(XalanNumberFormatFactory*   theFactory);
    00662
    00663
    00664     virtual tl_size_type
    00665     getTraceListeners() const;
    00666
    00667     virtual void
    00668     fireGenerateEvent(const GenerateEvent&  ge);
    00669
    00670     virtual void
    00671     fireTraceEvent(const TracerEvent&   te);
    00672
    00673     virtual void
    00674     fireSelectEvent(const SelectionEvent&   se);
    00675
    00676     virtual bool
    00677     getTraceSelects() const;
    00678
    00679     virtual void
    00680     traceSelect(
    00681             const ElemTemplateElement&  theStylesheetElement,
    00682             const NodeRefListBase&      nl,
    00683             const XPath*                xpath);
    00684
    00685     virtual int
    00686     collationCompare(
    00687             const XalanDOMString&               theLHS,
    00688             const XalanDOMString&               theRHS,
    00689             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00690
    00691     virtual int
    00692     collationCompare(
    00693             const XalanDOMString&               theLHS,
    00694             const XalanDOMString&               theRHS,
    00695             const XalanDOMString&               theLocale,
    00696             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00697
    00698     virtual int
    00699     collationCompare(
    00700             const XalanDOMChar*                 theLHS,
    00701             const XalanDOMChar*                 theRHS,
    00702             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00703
    00704     virtual int
    00705     collationCompare(
    00706             const XalanDOMChar*                 theLHS,
    00707             const XalanDOMChar*                 theRHS,
    00708             const XalanDOMChar*                 theLocale,
    00709             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault);
    00710
    00711     typedef XalanCollationServices::CollationCompareFunctor     CollationCompareFunctor;
    00712
    00713     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
    00714     {
    00715     public:
    00716
    00717         DefaultCollationCompareFunctor();
    00718
    00719         virtual
    00720         ~DefaultCollationCompareFunctor();
    00721
    00722         virtual int
    00723         operator()(
    00724             const XalanDOMChar*                 theLHS,
    00725             const XalanDOMChar*                 theRHS,
    00726             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault) const;
    00727
    00728         virtual int
    00729         operator()(
    00730             const XalanDOMChar*                 theLHS,
    00731             const XalanDOMChar*                 theRHS,
    00732             const XalanDOMChar*                 theLocale,
    00733             XalanCollationServices::eCaseOrder  theCaseOrder = XalanCollationServices::eDefault) const;
    00734     };
    00735
    00736
    00737     const CollationCompareFunctor*
    00738     installCollationCompareFunctor(CollationCompareFunctor*     theFunctor);
    00739
    00740     CollationCompareFunctor*
    00741     uninstallCollationCompareFunctor();
    00742
    00743
    00744     class XALAN_XSLT_EXPORT FormatNumberFunctor
    00745     {
    00746     public:
    00747
    00748         FormatNumberFunctor() {};
    00749
    00750         virtual
    00751         ~FormatNumberFunctor() {};
    00752
    00753         virtual void
    00754         operator() (
    00755             XPathExecutionContext&              executionContext,
    00756             double                              theNumber,
    00757             const XalanDOMString&               thePattern,
    00758             const XalanDecimalFormatSymbols*    theDFS,
    00759             XalanDOMString&                     theResult,
    00760             const XalanNode*                    context = 0,
    00761             const LocatorType*                  locator = 0) const = 0;
    00762     };
    00763
    00764     virtual void
    00765     formatNumber(
    00766             double                  number,
    00767             const XalanDOMString&   pattern,
    00768             XalanDOMString&         theResult,
    00769             const XalanNode*        context = 0,
    00770             const LocatorType*      locator = 0);
    00771
    00772     virtual void
    00773     formatNumber(
    00774             double                  number,
    00775             const XalanDOMString&   pattern,
    00776             const XalanDOMString&   dfsName,
    00777             XalanDOMString&         theResult,
    00778             const XalanNode*        context = 0,
    00779             const LocatorType*      locator = 0);
    00780
    00781
    00782     const FormatNumberFunctor*
    00783     installFormatNumberFunctor(FormatNumberFunctor*     formatNumberFunctor);
    00784
    00785     FormatNumberFunctor*
    00786     uninstallFormatNumberFunctor();
    00787
    00788     virtual bool
    00789     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
    00790
    00791     virtual void
    00792     beginConstruction(const KeyDeclaration&     keyDeclaration);
    00793
    00794     virtual void
    00795     endConstruction(const KeyDeclaration&   keyDeclaration);
    00796
    00797     virtual PrintWriter*
    00798     createPrintWriter(XalanOutputStream*        theTextOutputStream);
    00799
    00800     virtual PrintWriter*
    00801     createPrintWriter(
    00802             const XalanDOMString&       theFileName,
    00803             const XalanDOMString&       theEncoding);
    00804
    00805     virtual PrintWriter*
    00806     createPrintWriter(StreamType&   theStream);
    00807
    00808     virtual PrintWriter*
    00809     createPrintWriter(FILE*     theStream);
    00810
    00811     virtual CountersTable&
    00812     getCountersTable();
    00813
    00814     virtual void
    00815     characters(const XalanNode&     node);
    00816
    00817     virtual void
    00818     characters(const XObjectPtr&    xobject);
    00819
    00820     virtual void
    00821     charactersRaw(const XalanNode&  node);
    00822
    00823     virtual void
    00824     charactersRaw(const XObjectPtr&     xobject);
    00825
    00826
    00827     // These interfaces are inherited from XPathExecutionContext...
    00828
    00829     virtual void
    00830     reset();
    00831
    00832     virtual XalanNode*
    00833     getCurrentNode() const;
    00834
    00835     virtual void
    00836     pushCurrentNode(XalanNode*  theCurrentNode);
    00837
    00838     virtual void
    00839     popCurrentNode();
    00840
    00841     virtual bool
    00842     isNodeAfter(
    00843             const XalanNode&    node1,
    00844             const XalanNode&    node2) const;
    00845
    00846     virtual void
    00847     pushContextNodeList(const NodeRefListBase&  theList);
    00848
    00849     virtual void
    00850     popContextNodeList();
    00851
    00852     virtual const NodeRefListBase&
    00853     getContextNodeList() const;
    00854
    00855     virtual size_type
    00856     getContextNodeListLength() const;
    00857
    00858     virtual size_type
    00859     getContextNodeListPosition(const XalanNode&     contextNode) const;
    00860
    00861     virtual bool
    00862     elementAvailable(const XalanQName&  theQName) const;
    00863
    00864     virtual bool
    00865     elementAvailable(
    00866             const XalanDOMString&   theName,
    00867             const LocatorType*      locator) const;
    00868
    00869     virtual bool
    00870     functionAvailable(const XalanQName&     theQName) const;
    00871
    00872     virtual bool
    00873     functionAvailable(
    00874             const XalanDOMString&   theName,
    00875             const LocatorType*      locator) const;
    00876
    00877     virtual const XObjectPtr
    00878     extFunction(
    00879             const XalanDOMString&           theNamespace,
    00880             const XalanDOMString&           functionName,
    00881             XalanNode*                      context,
    00882             const XObjectArgVectorType&     argVec,
    00883             const LocatorType*              locator);
    00884
    00885     virtual XalanDocument*
    00886     parseXML(
    00887             MemoryManagerType&      theManager,
    00888             const XalanDOMString&   urlString,
    00889             const XalanDOMString&   base) const;
    00890
    00891     virtual MutableNodeRefList*
    00892     borrowMutableNodeRefList();
    00893
    00894     virtual bool
    00895     returnMutableNodeRefList(MutableNodeRefList*    theList);
    00896
    00897     virtual MutableNodeRefList*
    00898     createMutableNodeRefList(MemoryManagerType& theManager) const;
    00899
    00900 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    00901     virtual void
    00902     createUseAttributeSetIndexesOnStack();
    00903
    00904     virtual UseAttributeSetIndexes&
    00905     getUseAttributeSetIndexes();
    00906
    00907     virtual void
    00908     popUseAttributeSetIndexesFromStack();
    00909
    00910     virtual void
    00911     pushInvoker(const ElemTemplateElement * invoker);
    00912
    00913     virtual void
    00914     popInvoker();
    00915
    00916     virtual const ElemTemplateElement*
    00917     getInvoker() const;
    00918
    00919     virtual MutableNodeRefList&
    00920     createAndPushMutableNodeRefList();
    00921
    00922     virtual void
    00923     releaseAndPopMutableNodeRefList();
    00924
    00925     virtual void
    00926     pushXObjectPtr(const XObjectPtr& xobjectPtr);
    00927
    00928     virtual void
    00929     popXObjectPtr();
    00930
    00931     virtual void
    00932     createAndPushNodesToTransformList(const NodeRefListBase* nodeList);
    00933
    00934     virtual XalanNode*
    00935     getNextNodeToTransform();
    00936
    00937     virtual void
    00938     popNodesToTransformList();
    00939
    00940     virtual XalanDOMString&
    00941     getAndPushCachedString();
    00942
    00943     virtual XalanDOMString&
    00944     getLastCachedString();
    00945
    00946     virtual XalanDOMString&
    00947     getAndPopCachedString();
    00948 #endif
    00949
    00950     virtual XalanDOMString&
    00951     getCachedString();
    00952
    00953     virtual bool
    00954     releaseCachedString(XalanDOMString&     theString);
    00955
    00956
    00957     virtual void
    00958     getNodeSetByKey(
    00959             XalanDocument*          doc,
    00960             const XalanQName&       qname,
    00961             const XalanDOMString&   ref,
    00962             MutableNodeRefList&     nodelist);
    00963
    00964     virtual void
    00965     getNodeSetByKey(
    00966             XalanDocument*          doc,
    00967             const XalanDOMString&   name,
    00968             const XalanDOMString&   ref,
    00969             const LocatorType*      locator,
    00970             MutableNodeRefList&     nodelist);
    00971
    00972     virtual const XObjectPtr
    00973     getVariable(
    00974             const XalanQName&   name,
    00975             const LocatorType*  locator = 0);
    00976
    00977     virtual const PrefixResolver*
    00978     getPrefixResolver() const;
    00979
    00980     virtual void
    00981     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
    00982
    00983     virtual const XalanDOMString*
    00984     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
    00985
    00986     virtual const XalanDOMString&
    00987     findURIFromDoc(const XalanDocument*     owner) const;
    00988
    00989     virtual const XalanDOMString&
    00990     getUnparsedEntityURI(
    00991             const XalanDOMString&   theName,
    00992             const XalanDocument&    theDocument) const;
    00993
    00994     virtual bool
    00995     shouldStripSourceNode(const XalanText&  node);
    00996
    00997     virtual XalanDocument*
    00998     getSourceDocument(const XalanDOMString&     theURI) const;
    00999
    01000     virtual void
    01001     setSourceDocument(
    01002             const XalanDOMString&   theURI,
    01003             XalanDocument*          theDocument);
    01004
    01005     // These interfaces are inherited from ExecutionContext...
    01006
    01007     virtual void
    01008     error(
    01009             const XalanDOMString&   msg,
    01010             const XalanNode*        sourceNode,
    01011             const LocatorType*      locator) const;
    01012
    01013     virtual void
    01014     warn(
    01015             const XalanDOMString&   msg,
    01016             const XalanNode*        sourceNode,
    01017             const LocatorType*      locator) const;
    01018
    01019     virtual void
    01020     message(
    01021             const XalanDOMString&   msg,
    01022             const XalanNode*    sourceNode,
    01023             const LocatorType*  locator) const;
    01024
    01025
    01026     class XPathCacheReturnFunctor
    01027     {
    01028     public:
    01029
    01030         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
    01031             m_xsltProcessor(xsltProcessor)
    01032         {
    01033         }
    01034
    01035         void
    01036         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
    01037
    01038     private:
    01039
    01040         XSLTEngineImpl&     m_xsltProcessor;
    01041     };
    01042
    01047     XalanSourceTreeDocument*
    01048     getSourceTreeFactory(MemoryManagerType& theManager) const;
    01049
    01050 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    01051 protected:
    01052
    01053     virtual FormatterToText*
    01054     borrowFormatterToText();
    01055
    01056     virtual bool
    01057     returnFormatterToText(FormatterToText*  theFormatter);
    01058 #endif
    01059
    01060 private:
    01061
    01062     const XalanDecimalFormatSymbols*
    01063     getDecimalFormatSymbols(const XalanQName&   qname);
    01064
    01065 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    01066
    01073     void
    01074     getParams(
    01075             const ElemTemplateElement&  xslCallTemplateElement,
    01076             ParamsVectorType&           params);
    01077 #endif
    01078
    01085     bool
    01086     isCached(const XPath*   theXPath);
    01087
    01091     void
    01092     clearXPathCache();
    01093
    01101     void
    01102     addToXPathCache(
    01103             const XalanDOMString&   pattern,
    01104             const XPath*            theXPath);
    01105
    01106
    01110     void
    01111     cleanUpTransients();
    01112
    01113     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
    01114
    01115     XSLTEngineImpl*                 m_xsltProcessor;
    01116
    01117     XalanNode*                      m_rootDocument;
    01118
    01119     enum { eXPathCacheMax = 50,
    01120            eDefaultParamsVectorSize = 10,
    01121            eXResultTreeFragAllocatorBlockSize = 10,
    01122            eDocumentAllocatorBlockSize = 10,
    01123            eDocumentFragmentAllocatorBlockSize = 10,
    01124            eDefaultAttributeAllocatorBlockSize = 10,
    01125            eDefaultAttributeNSAllocatorBlockSize = 10,
    01126            eDefaultCommentAllocatorBlockSize = 10,
    01127            eDefaultElementAllocatorBlockSize = 10,
    01128            eDefaultElementNSAllocatorBlockSize = 10,
    01129            eDefaultPIAllocatorBlockSize = 10,
    01130            eDefaultTextAllocatorBlockSize = 20,
    01131            eDefaultTextIWSAllocatorBlockSize = 20 };
    01132
    01133     ElementTemplateElementStackType     m_elementRecursionStack;
    01134
    01135     const StylesheetRoot*               m_stylesheetRoot;
    01136
    01137     FormatterListenerVectorType         m_formatterListeners;
    01138
    01139     PrintWriterVectorType               m_printWriters;
    01140
    01141     OutputStreamVectorType              m_outputStreams;
    01142
    01143     CollationCompareFunctor*            m_collationCompareFunctor;
    01144
    01145     FormatNumberFunctor *               m_formatNumberFunctor;
    01146
    01150     VariablesStack                      m_variablesStack;
    01151
    01152     ParamsVectorType                    m_paramsVector;
    01153
    01154     XPathCacheMapType                   m_matchPatternCache;
    01155
    01156     KeyTablesTableType                  m_keyTables;
    01157
    01158     KeyDeclarationSetType               m_keyDeclarationSet;
    01159
    01160     CountersTable                       m_countersTable;
    01161
    01166     mutable XalanMemMgrAutoPtr<XalanSourceTreeDocument, true>   m_sourceTreeResultTreeFactory;
    01167
    01168     // Holds the current mode.
    01169     const XalanQName*                   m_mode;
    01170
    01171     CurrentTemplateStackType            m_currentTemplateStack;
    01172
    01173     int                                 m_indentAmount;
    01174
    01175     XResultTreeFragAllocator            m_xresultTreeFragAllocator;
    01176
    01177     XalanSourceTreeDocumentFragmentAllocator    m_documentFragmentAllocator;
    01178
    01179     XalanSourceTreeDocumentAllocator    m_documentAllocator;
    01180
    01181     typedef XalanVector<bool>       BooleanStackType;
    01182     typedef XalanVector<const XalanQName*>  ModeStackType;
    01183     typedef XalanVector<int>            IntStackType;
    01184
    01185     BooleanStackType                    m_copyTextNodesOnlyStack;
    01186     ModeStackType                       m_modeStack;
    01187     IntStackType                        m_currentIndexStack;
    01188
    01189 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    01190     typedef XalanObjectCacheDefault<FormatterToText>    FormatterToTextCacheType;
    01191     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
    01192     typedef XalanObjectCacheDefault<NodeSorter>     NodeSorterCacheType;
    01193
    01194     FormatterToTextCacheType            m_formatterToTextCache;
    01195
    01196     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
    01197
    01198     NodeSorterCacheType                 m_nodeSorterCache;
    01199 #endif
    01200
    01201 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
    01202     class FormatterToTextDOMString : public FormatterToText
    01203     {
    01204     public:
    01205
    01206         FormatterToTextDOMString(MemoryManagerType& theManager);
    01207
    01208         virtual
    01209         ~FormatterToTextDOMString();
    01210
    01211         void
    01212         setDOMString(XalanDOMString&    theString)
    01213         {
    01214             m_printWriter.setString(theString);
    01215         }
    01216
    01217     private:
    01218
    01219         DOMStringPrintWriter    m_printWriter;
    01220
    01221         static XalanDOMString   s_dummyString;
    01222     };
    01223
    01224     typedef XalanVector<XObjectPtr>                             XObjectPtrStackType;
    01225     typedef XalanVector<ParamsVectorType>                       ParamsVectorStackType;
    01226     typedef XalanVector<UseAttributeSetIndexes>                 UseAttributeSetIndexesStackType;
    01227     typedef XalanObjectStackCache<MutableNodeRefList,DefaultCacheCreateFunctorMemMgr<MutableNodeRefList> >
    01228                                                                 MutableNodeRefListStackType;
    01229
    01230     typedef XalanObjectStackCache<XalanDOMString,DefaultCacheCreateFunctorMemMgr<XalanDOMString> >
    01231                                                                 StringStackType;
    01232
    01233     typedef XalanObjectStackCache<FormatterToTextDOMString,DefaultCacheCreateFunctorMemMgr<FormatterToTextDOMString> >
    01234                                                                 FormatterToTextStackType;
    01235     typedef XalanObjectStackCache<FormatterToSourceTree,DefaultCacheCreateFunctorMemMgr<FormatterToSourceTree> >
    01236                                                                 FormatterToSourceTreeStackType;
    01237
    01238     /*
    01239      * class to maintain the list of nodes to be transformed by an element
    01240      */
    01241     class NodesToTransform
    01242     {
    01243     public:
    01244         NodesToTransform(const NodeRefListBase* nodeList) :
    01245             m_nodeList(nodeList), m_index(0)
    01246         {
    01247             assert(m_nodeList != 0);
    01248         }
    01249
    01250         const NodeRefListBase* operator() ()
    01251         {
    01252             return m_nodeList;
    01253         }
    01254
    01255         NodeRefListBase::size_type& index()
    01256         {
    01257             return m_index;
    01258         }
    01259
    01260         XalanNode* next()
    01261         {
    01262             if (m_index < m_nodeList->getLength())
    01263             {
    01264                 return m_nodeList->item(m_index++);
    01265             }
    01266             return 0;
    01267         }
    01268
    01269     private:
    01270         const NodeRefListBase*  m_nodeList;
    01271         NodeRefListBase::size_type  m_index;
    01272     };
    01273
    01274     typedef XalanVector<NodesToTransform>           NodesToTransformStackType;
    01275
    01276     XObjectPtrStackType                 m_xobjectPtrStack;
    01277     MutableNodeRefListStackType         m_mutableNodeRefListStack;
    01278     NodesToTransformStackType           m_nodesToTransformStack;
    01279     BooleanStackType                    m_processCurrentAttributeStack;
    01280     BooleanStackType                    m_executeIfStack;
    01281     StringStackType                     m_stringStack;
    01282     FormatterToTextStackType            m_formatterToTextStack;
    01283     BooleanStackType                    m_skipElementAttributesStack;
    01284     FormatterToSourceTreeStackType      m_formatterToSourceTreeStack;
    01285     ParamsVectorStackType               m_paramsVectorStack;
    01286     ElementTemplateElementStackType     m_elementInvokerStack;
    01287     UseAttributeSetIndexesStackType     m_useAttributeSetIndexesStack;
    01288
    01289     NodeSorter                          m_nodeSorter;
    01290 #endif
    01291
    01292     // If true, we will use a separate document factory for
    01293     // result tree fragments.
    01294     bool                                m_usePerInstanceDocumentFactory;
    01295
    01296     // Determines whether or not to override the property in the stylesheet.
    01297     eEscapeURLs                         m_escapeURLs;
    01298
    01299     // Determines whether or not to override the property in the stylesheet.
    01300     eOmitMETATag                        m_omitMETATag;
    01301
    01302     bool                                m_hasStripOrPreserveSpace;
    01303
    01304     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
    01305
    01306     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
    01307
    01308     static const DefaultCollationCompareFunctor     s_defaultCollationFunctor;
    01309
    01310 };
    01311
    01312
    01313
    01314 XALAN_CPP_NAMESPACE_END
    01315
    01316
    01317
    01318 #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.9 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.