Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.3

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 The Apache Software Foundation.  All rights 
00006  * reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer. 
00014  *
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in
00017  *    the documentation and/or other materials provided with the
00018  *    distribution.
00019  *
00020  * 3. The end-user documentation included with the redistribution,
00021  *    if any, must include the following acknowledgment:  
00022  *       "This product includes software developed by the
00023  *        Apache Software Foundation (http://www.apache.org/)."
00024  *    Alternately, this acknowledgment may appear in the software itself,
00025  *    if and wherever such third-party acknowledgments normally appear.
00026  *
00027  * 4. The names "Xalan" and "Apache Software Foundation" must
00028  *    not be used to endorse or promote products derived from this
00029  *    software without prior written permission. For written 
00030  *    permission, please contact apache@apache.org.
00031  *
00032  * 5. Products derived from this software may not be called "Apache",
00033  *    nor may "Apache" appear in their name, without prior written
00034  *    permission of the Apache Software Foundation.
00035  *
00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00039  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00040  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00041  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00042  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00043  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00044  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00045  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00046  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00047  * SUCH DAMAGE.
00048  * ====================================================================
00049  *
00050  * This software consists of voluntary contributions made by many
00051  * individuals on behalf of the Apache Software Foundation and was
00052  * originally based on software copyright (c) 1999, International
00053  * Business Machines, Inc., http://www.ibm.com.  For more
00054  * information on the Apache Software Foundation, please see
00055  * <http://www.apache.org/>.
00056  *
00057  * @author <a href="mailto:david_n_bertoni@lotus.com">David N. Bertoni</a>
00058  */
00059 #if !defined(STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
00060 #define STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
00061 
00062 
00063 
00064 // Base class include file.
00065 #include <XSLT/StylesheetExecutionContext.hpp>
00066 
00067 
00068 
00069 #include <ctime>
00070 #include <deque>
00071 #include <memory>
00072 #include <set>
00073 #include <vector>
00074 
00075 
00076 
00077 #include <Include/XalanObjectCache.hpp>
00078 
00079 
00080 
00081 #include <XPath/XPathExecutionContextDefault.hpp>
00082 
00083 
00084 
00085 #include <XMLSupport/FormatterToText.hpp>
00086 
00087 
00088 
00089 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
00090 #include <XalanSourceTree/XalanSourceTreeDocument.hpp>
00091 #endif
00092 #include <XalanSourceTree/FormatterToSourceTree.hpp>
00093 #include <XalanSourceTree/XalanSourceTreeDocumentFragment.hpp>
00094 
00095 
00096 
00097 #include <XSLT/CountersTable.hpp>
00098 #include <XSLT/NodeSorter.hpp>
00099 #include <XSLT/ResultTreeFrag.hpp>
00100 #include <XSLT/ResultTreeFragAllocator.hpp>
00101 #include <XSLT/Stylesheet.hpp>
00102 #include <XSLT/VariablesStack.hpp>
00103 #include <XSLT/XResultTreeFragAllocator.hpp>
00104 #include <XSLT/XalanSourceTreeDocumentFragmentAllocator.hpp>
00105 
00106 
00107 
00108 class XalanSourceTreeDocument;
00109 class XPathProcessor;
00110 class XObjectFactory;
00111 class XSLTEngineImpl;
00112 
00113 
00114 
00115 //
00116 // An class which provides support for executing stylesheets.
00117 //
00118 class XALAN_XSLT_EXPORT StylesheetExecutionContextDefault : public StylesheetExecutionContext
00119 {
00120 public:
00121 
00122 #if defined(XALAN_NO_NAMESPACES)
00123     typedef deque<const ElemTemplateElement*>           ElementRecursionStackType;
00124     typedef vector<FormatterListener*>                  FormatterListenerVectorType;
00125     typedef vector<PrintWriter*>                        PrintWriterVectorType;
00126     typedef vector<XalanOutputStream*>                  OutputStreamVectorType;
00127     typedef set<const KeyDeclaration*,
00128                 less<const KeyDeclaration*> >           KeyDeclarationSetType;
00129     typedef pair<const XPath*, clock_t>                 XPathCacheEntry;
00130     typedef map<XalanDOMString,
00131                 XPathCacheEntry,
00132                 less<XalanDOMString> >                  XPathCacheMapType;
00133 #else
00134     typedef std::deque<const ElemTemplateElement*>      ElementRecursionStackType;
00135     typedef std::vector<FormatterListener*>             FormatterListenerVectorType;
00136     typedef std::vector<PrintWriter*>                   PrintWriterVectorType;
00137     typedef std::vector<XalanOutputStream*>             OutputStreamVectorType;
00138     typedef std::set<const KeyDeclaration*>             KeyDeclarationSetType;
00139     typedef std::pair<const XPath*, clock_t>            XPathCacheEntry;
00140     typedef std::map<XalanDOMString, XPathCacheEntry>   XPathCacheMapType;
00141 #endif
00142 
00143     typedef Stylesheet::KeyTablesTableType              KeyTablesTableType;
00144     typedef VariablesStack::ParamsVectorType            ParamsVectorType;
00145 
00146     
00157     StylesheetExecutionContextDefault(
00158             XSLTEngineImpl&         xsltProcessor,
00159             XPathEnvSupport&        theXPathEnvSupport,
00160             DOMSupport&             theDOMSupport,
00161             XObjectFactory&         theXObjectFactory,
00162             XalanNode*              theCurrentNode = 0,
00163             const NodeRefListBase*  theContextNodeList = 0,
00164             const PrefixResolver*   thePrefixResolver = 0);
00165 
00176     explicit
00177     StylesheetExecutionContextDefault(
00178             XalanNode*              theCurrentNode = 0,
00179             const NodeRefListBase*  theContextNodeList = 0,
00180             const PrefixResolver*   thePrefixResolver = 0);
00181 
00182     virtual
00183     ~StylesheetExecutionContextDefault();
00184 
00185 
00197     bool
00198     setIgnoreHTMLElementNamespaces() const
00199     {
00200         return m_ignoreHTMLElementNamespaces;
00201     }
00202 
00209     void
00210     setIgnoreHTMLElementNamespaces(bool     theValue)
00211     {
00212         m_ignoreHTMLElementNamespaces = theValue;
00213     }
00214 
00220     void
00221     setXPathEnvSupport(XPathEnvSupport*     theSupport)
00222     {
00223         m_xpathExecutionContextDefault.setXPathEnvSupport(theSupport);
00224     }
00225 
00231     void
00232     setXObjectFactory(XObjectFactory*   theFactory)
00233     {
00234         m_xpathExecutionContextDefault.setXObjectFactory(theFactory);
00235     }
00236 
00242     void
00243     setDOMSupport(DOMSupport*   theDOMSupport)
00244     {
00245         m_xpathExecutionContextDefault.setDOMSupport(theDOMSupport);
00246     }
00247 
00248 
00254     void
00255     setXSLTProcessor(XSLTEngineImpl*    theProcessor)
00256     {
00257         m_xsltProcessor = theProcessor;
00258     }
00259 
00260 
00261     // These interfaces are inherited from StylesheetExecutionContext...
00262 
00263     virtual bool
00264     getQuietConflictWarnings() const;
00265 
00266     virtual XalanNode*
00267     getRootDocument() const;
00268 
00269     virtual void
00270     setRootDocument(XalanNode*  theDocument);
00271 
00272     virtual XalanDocument*
00273     createDocument() const;
00274 
00275     virtual void
00276     setStylesheetRoot(const StylesheetRoot*     theStylesheet);
00277 
00278     virtual const XalanQName*
00279     getCurrentMode() const;
00280 
00281     virtual void
00282     setCurrentMode(const XalanQName*    theMode); 
00283 
00284     virtual bool
00285     doDiagnosticsOutput() const;
00286 
00287     virtual void
00288     diag(const XalanDOMString&  theString);
00289 
00290     virtual void
00291     pushTime(const void*    theKey);
00292 
00293     virtual void
00294     displayDuration(
00295             const XalanDOMString&   theMessage,
00296             const void*             theKey);
00297 
00298     virtual bool
00299     isElementPending() const;
00300 
00301     virtual void
00302     replacePendingAttribute(
00303             const XalanDOMChar*     theName,
00304             const XalanDOMChar*     theNewType,
00305             const XalanDOMChar*     theNewValue);
00306 
00307     virtual void
00308     pushOutputContext(FormatterListener*    flistener = 0);
00309 
00310     virtual void
00311     popOutputContext();
00312 
00313     virtual void
00314     addResultAttribute(
00315             const XalanDOMString&   aname,
00316             const XalanDOMString&   value);
00317 
00318     virtual void
00319     copyNamespaceAttributes(const XalanNode&    src);
00320 
00321     virtual const XalanDOMString*
00322     getResultPrefixForNamespace(const XalanDOMString&   theNamespace) const;
00323 
00324     virtual const XalanDOMString*
00325     getResultNamespaceForPrefix(const XalanDOMString&   thePrefix) const;
00326 
00327     virtual bool
00328     isPendingResultPrefix(const XalanDOMString& thePrefix);
00329 
00330     virtual XalanDOMString
00331     getUniqueNamespaceValue() const;
00332 
00333     virtual void
00334     getUniqueNamespaceValue(XalanDOMString&     theValue) const;
00335 
00336     virtual FormatterListener*
00337     getFormatterListener() const;
00338 
00339     virtual void
00340     setFormatterListener(FormatterListener*     flistener);
00341 
00342     virtual int
00343     getIndent() const;
00344 
00345     virtual void
00346     setIndent(int   indentAmount);
00347 
00348     // $$$ ToDo: Get rid of this!!!!
00349     virtual const XObjectPtr
00350     executeXPath(
00351             const XalanDOMString&   str,
00352             XalanNode*              contextNode,
00353             const XalanElement&     resolver);
00354 
00355     virtual const XPath*
00356     createMatchPattern(
00357             const XalanDOMString&   str,
00358             const PrefixResolver&   resolver);
00359 
00360     virtual void
00361     returnXPath(const XPath*    xpath);
00362 
00363     virtual void
00364     pushTopLevelVariables(const ParamVectorType&    topLevelParams);
00365 
00366     virtual const XObjectPtr
00367     createVariable(
00368             const ElemTemplateElement*  element,
00369             const XPath&                xpath,
00370             XalanNode*                  contextNode,
00371             const PrefixResolver&       resolver);
00372 
00373     virtual const XObjectPtr
00374     createVariable(
00375             const ElemTemplateElement*  element,
00376             const ElemTemplateElement&  templateChild,
00377             XalanNode*                  sourceNode);
00378 
00379     virtual void
00380     pushVariable(
00381             const XalanQName&           name,
00382             const ElemTemplateElement*  element,
00383             const XalanDOMString&       str,
00384             XalanNode*                  contextNode,
00385             const PrefixResolver&       resolver);
00386 
00387     virtual void
00388     pushVariable(
00389             const XalanQName&           name,
00390             const XObjectPtr            val,
00391             const ElemTemplateElement*  element);
00392 
00393     virtual void
00394     pushVariable(
00395             const XalanQName&           name,
00396             const ElemVariable*         var,
00397             const ElemTemplateElement*  element);
00398 
00399     virtual void
00400     pushVariable(
00401             const XalanQName&           name,
00402             const ElemTemplateElement*  element,
00403             const XPath&                xpath,
00404             XalanNode*                  contextNode,
00405             const PrefixResolver&       resolver);
00406 
00407     virtual void
00408     pushVariable(
00409             const XalanQName&           name,
00410             const ElemTemplateElement*  element,
00411             const ElemTemplateElement&  templateChild,
00412             XalanNode*                  sourceNode);
00413 
00414     virtual void
00415     pushContextMarker();
00416 
00417     virtual void
00418     popContextMarker();
00419 
00420     virtual void
00421     resolveTopLevelParams();
00422 
00423     virtual void
00424     clearTopLevelParams();
00425 
00426     virtual void
00427     pushParams(
00428             const ElemTemplateElement&  xslCallTemplateElement,
00429             XalanNode*                  sourceNode,
00430             const ElemTemplateElement*  targetTemplate);
00431 
00432     virtual const XObjectPtr
00433     getParamVariable(const XalanQName&  theName);
00434 
00435     virtual void
00436     pushElementFrame(const ElemTemplateElement*     elem);
00437 
00438     virtual void
00439     popElementFrame(const ElemTemplateElement*  elem);
00440 
00441     virtual int
00442     getGlobalStackFrameIndex() const;
00443 
00444     virtual int
00445     getCurrentStackFrameIndex() const;
00446 
00447     virtual void
00448     setCurrentStackFrameIndex(int currentStackFrameIndex = -1);
00449 
00450     virtual void
00451     startDocument();
00452 
00453     virtual void
00454     endDocument();
00455 
00456     virtual void
00457     startElement(const XalanDOMChar*    name);
00458 
00459     virtual void
00460     endElement(const XalanDOMChar*  name);
00461 
00462     virtual void
00463     characters(
00464             const XalanDOMChar*         ch,
00465             XalanDOMString::size_type   start,
00466             XalanDOMString::size_type   length);
00467 
00468     virtual void
00469     charactersRaw(
00470             const XalanDOMChar*         ch,
00471             XalanDOMString::size_type   start,
00472             XalanDOMString::size_type   length);
00473 
00474     virtual void
00475     comment(const XalanDOMChar*     data);
00476 
00477     virtual void
00478     processingInstruction(
00479             const XalanDOMChar*     target,
00480             const XalanDOMChar*     data);
00481 
00482     virtual void
00483     flushPending();
00484 
00485     virtual void
00486     cloneToResultTree(
00487             XalanNode&                  node,
00488             XalanNode::NodeType         nodeType,
00489             bool                        isLiteral,
00490             bool                        overrideStrip,
00491             bool                        shouldCloneAttributes,
00492             const ElemTemplateElement*  styleNode = 0);
00493 
00494     virtual const XObjectPtr
00495     createXResultTreeFrag(
00496             const ElemTemplateElement&  templateChild,
00497             XalanNode*                  sourceNode);
00498 
00499     virtual void
00500     outputToResultTree(const XObject&   xobj);
00501 
00502     virtual void
00503     outputResultTreeFragment(const XObject&     theTree);
00504 
00505     virtual const XalanDOMString&
00506     getXSLNameSpaceURL() const;
00507 
00508     virtual const XalanDOMString&
00509     getXalanXSLNameSpaceURL() const;
00510 
00511     virtual bool
00512     findOnElementRecursionStack(const ElemTemplateElement*  theElement) const;
00513 
00514     virtual void
00515     pushOnElementRecursionStack(const ElemTemplateElement*  theElement);
00516 
00517     virtual const ElemTemplateElement*
00518     popElementRecursionStack();
00519 
00520     virtual bool
00521     returnXResultTreeFrag(XResultTreeFrag*  theXResultTreeFrag);
00522 
00523     virtual FormatterToXML*
00524     createFormatterToXML(
00525             Writer&                 writer,
00526             const XalanDOMString&   version = XalanDOMString(),
00527             bool                    doIndent = false,
00528             int                     indent = 0,
00529             const XalanDOMString&   encoding = XalanDOMString(),
00530             const XalanDOMString&   mediaType = XalanDOMString(),
00531             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00532             const XalanDOMString&   doctypePublic = XalanDOMString(),
00533             bool                    xmlDecl = true,
00534             const XalanDOMString&   standalone = XalanDOMString());
00535 
00536     virtual FormatterToHTML*
00537     createFormatterToHTML(
00538             Writer&                 writer,
00539             const XalanDOMString&   encoding = XalanDOMString(),
00540             const XalanDOMString&   mediaType = XalanDOMString(),
00541             const XalanDOMString&   doctypeSystem = XalanDOMString(),
00542             const XalanDOMString&   doctypePublic = XalanDOMString(),
00543             bool                    doIndent = true,
00544             int                     indent = 4,
00545             const XalanDOMString&   version = XalanDOMString(),
00546             const XalanDOMString&   standalone = XalanDOMString(),
00547             bool                    xmlDecl = false);
00548 
00549     virtual FormatterToDOM*
00550     createFormatterToDOM(
00551             XalanDocument*          doc,
00552             XalanDocumentFragment*  docFrag,
00553             XalanElement*           currentElement);
00554 
00555     virtual FormatterToDOM*
00556     createFormatterToDOM(
00557             XalanDocument*  doc,
00558             XalanElement*   elem);
00559 
00560     virtual FormatterToText*
00561     createFormatterToText(
00562             Writer&                 writer,
00563             const XalanDOMString&   encoding);
00564 
00565     virtual FormatterToText*
00566     borrowFormatterToText();
00567 
00568     virtual bool
00569     returnFormatterToText(FormatterToText*  theFormatter);
00570 
00571     virtual NodeSorter*
00572     borrowNodeSorter();
00573 
00574     virtual bool
00575     returnNodeSorter(NodeSorter*    theSorter);
00576 
00577     virtual XalanNumberFormatAutoPtr
00578     createXalanNumberFormat();
00579 
00580     // A basic class to create XalanNumberFormat instances...
00581     class XALAN_XSLT_EXPORT XalanNumberFormatFactory
00582     {
00583     public:
00584 
00585         explicit
00586         XalanNumberFormatFactory();
00587 
00588         virtual
00589         ~XalanNumberFormatFactory();
00590 
00591         virtual XalanNumberFormat*
00592         create();
00593     };
00594 
00595     static XalanNumberFormatFactory&
00596     getDefaultXalanNumberFormatFactory()
00597     {
00598         return s_defaultXalanNumberFormatFactory;
00599     }
00600 
00608     static XalanNumberFormatFactory*
00609     installXalanNumberFormatFactory(XalanNumberFormatFactory*   theFactory);
00610 
00611 
00612     virtual size_type
00613     getTraceListeners() const;
00614 
00615     virtual void
00616     fireGenerateEvent(const GenerateEvent&  ge);
00617 
00618     virtual void
00619     fireTraceEvent(const TracerEvent&   te);
00620 
00621     virtual void
00622     fireSelectEvent(const SelectionEvent&   se);
00623 
00624     virtual bool
00625     getTraceSelects() const;
00626 
00627     virtual void
00628     traceSelect(
00629             const XalanElement&     theTemplate,
00630             const NodeRefListBase&  nl) const;
00631 
00632     virtual int
00633     collationCompare(
00634             const XalanDOMString&   theLHS,
00635             const XalanDOMString&   theRHS);
00636 
00637     virtual int
00638     collationCompare(
00639             const XalanDOMString&   theLHS,
00640             const XalanDOMString&   theRHS,
00641             const XalanDOMString&   theLocale);
00642 
00643     virtual int
00644     collationCompare(
00645             const XalanDOMChar*     theLHS,
00646             const XalanDOMChar*     theRHS);
00647 
00648     virtual int
00649     collationCompare(
00650             const XalanDOMChar*     theLHS,
00651             const XalanDOMChar*     theRHS,
00652             const XalanDOMChar*     theLocale);
00653 
00654     class XALAN_XSLT_EXPORT CollationCompareFunctor
00655     {
00656     public:
00657 
00658         CollationCompareFunctor();
00659 
00660         virtual
00661         ~CollationCompareFunctor();
00662 
00663         // Const version is suitable for use by
00664         // multiple threads.
00665         virtual int
00666         operator()(
00667             const XalanDOMChar*     theLHS,
00668             const XalanDOMChar*     theRHS) const = 0;
00669 
00670         // Const version is suitable for use by
00671         // multiple threads.
00672         virtual int
00673         operator()(
00674             const XalanDOMChar*     theLHS,
00675             const XalanDOMChar*     theRHS,
00676             const XalanDOMChar*     theLocale) const = 0;
00677     };
00678 
00679     class XALAN_XSLT_EXPORT DefaultCollationCompareFunctor : public CollationCompareFunctor
00680     {
00681     public:
00682 
00683         DefaultCollationCompareFunctor();
00684 
00685         virtual
00686         ~DefaultCollationCompareFunctor();
00687 
00688         virtual int
00689         operator()(
00690             const XalanDOMChar*     theLHS,
00691             const XalanDOMChar*     theRHS) const;
00692 
00693         virtual int
00694         operator()(
00695             const XalanDOMChar*     theLHS,
00696             const XalanDOMChar*     theRHS,
00697             const XalanDOMChar*     theLocale) const;
00698     };
00699 
00700     const CollationCompareFunctor*
00701     installCollationCompareFunctor(const CollationCompareFunctor*   theFunctor);
00702 
00703     virtual bool
00704     getInConstruction(const KeyDeclaration&     keyDeclaration) const;
00705 
00706     virtual void
00707     beginConstruction(const KeyDeclaration&     keyDeclaration);
00708 
00709     virtual void
00710     endConstruction(const KeyDeclaration&   keyDeclaration);
00711 
00712     virtual const XalanDecimalFormatSymbols*
00713     getDecimalFormatSymbols(const XalanQName&   qname);
00714 
00715     virtual PrintWriter*
00716     createPrintWriter(XalanOutputStream*        theTextOutputStream);
00717 
00718     virtual PrintWriter*
00719     createPrintWriter(
00720             const XalanDOMString&       theFileName,
00721             const XalanDOMString&       theEncoding);
00722 
00723     virtual PrintWriter*
00724 #if defined(XALAN_NO_NAMESPACES)
00725     createPrintWriter(ostream&          theStream);
00726 #else
00727     createPrintWriter(std::ostream&     theStream);
00728 #endif
00729 
00730     virtual CountersTable&
00731     getCountersTable();
00732 
00733     virtual void
00734     characters(const XalanNode&     node);
00735 
00736     virtual void
00737     characters(const XObjectPtr&    xobject);
00738 
00739     virtual void
00740     charactersRaw(const XalanNode&  node);
00741 
00742     virtual void
00743     charactersRaw(const XObjectPtr&     xobject);
00744 
00745 
00746     // These interfaces are inherited from XPathExecutionContext...
00747 
00748     virtual void
00749     reset();
00750 
00751     virtual XalanNode*
00752     getCurrentNode() const;
00753 
00754     virtual void
00755     setCurrentNode(XalanNode*   theCurrentNode);
00756 
00757     virtual XObjectFactory&
00758     getXObjectFactory() const;
00759 
00760     virtual XObjectPtr
00761     createNodeSet(XalanNode&    theNode);
00762 
00763     virtual bool
00764     isNodeAfter(
00765             const XalanNode&    node1,
00766             const XalanNode&    node2) const;
00767 
00768     virtual const NodeRefListBase&
00769     getContextNodeList() const;
00770 
00771     virtual void    
00772     setContextNodeList(const NodeRefListBase&   theList);
00773 
00774     virtual size_type
00775     getContextNodeListLength() const;
00776 
00777     virtual size_type
00778     getContextNodeListPosition(const XalanNode&     contextNode) const;
00779 
00780     virtual bool
00781     elementAvailable(
00782             const XalanDOMString&   theNamespace, 
00783             const XalanDOMString&   elementName) const;
00784 
00785     virtual bool
00786     functionAvailable(
00787             const XalanDOMString&   theNamespace, 
00788             const XalanDOMString&   functionName) const;
00789 
00790     virtual const XObjectPtr
00791     extFunction(
00792             const XalanDOMString&           theNamespace,
00793             const XalanDOMString&           functionName,
00794             XalanNode*                      context,
00795             const XObjectArgVectorType&     argVec,
00796             const Locator*                  locator);
00797 
00798     virtual XalanDocument*
00799     parseXML(
00800             const XalanDOMString&   urlString,
00801             const XalanDOMString&   base) const;
00802 
00803     virtual MutableNodeRefList*
00804     borrowMutableNodeRefList();
00805 
00806     virtual bool
00807     returnMutableNodeRefList(MutableNodeRefList*    theList);
00808 
00809     virtual MutableNodeRefList*
00810     createMutableNodeRefList() const;
00811 
00812     virtual XalanDOMString&
00813     getCachedString();
00814 
00815     virtual bool
00816     releaseCachedString(XalanDOMString&     theString);
00817 
00818     virtual void
00819     getNodeSetByKey(            
00820             XalanNode*              doc,
00821             const XalanDOMString&   name,
00822             const XalanDOMString&   ref,
00823             const PrefixResolver&   resolver,
00824             MutableNodeRefList&     nodelist);
00825 
00826     virtual const XObjectPtr
00827     getVariable(
00828             const XalanQName&   name,
00829             const Locator*      locator = 0);
00830 
00831     virtual const PrefixResolver*
00832     getPrefixResolver() const;
00833 
00834     virtual void
00835     setPrefixResolver(const PrefixResolver*     thePrefixResolver);
00836 
00837     virtual const XalanDOMString*
00838     getNamespaceForPrefix(const XalanDOMString&     prefix) const;
00839 
00840     virtual XalanDOMString
00841     findURIFromDoc(const XalanDocument*     owner) const;
00842 
00843     virtual const XalanDOMString&
00844     getUnparsedEntityURI(
00845             const XalanDOMString&   theName,
00846             const XalanDocument&    theDocument) const;
00847 
00848     virtual bool
00849     shouldStripSourceNode(const XalanNode&  node);
00850 
00851     virtual bool
00852     getThrowFoundIndex() const;
00853 
00854     virtual void
00855     setThrowFoundIndex(bool     fThrow);
00856 
00857     virtual XalanDocument*
00858     getSourceDocument(const XalanDOMString&     theURI) const;
00859 
00860     virtual void
00861     setSourceDocument(
00862             const XalanDOMString&   theURI,
00863             XalanDocument*          theDocument);
00864 
00865 
00866     // These interfaces are inherited from ExecutionContext...
00867 
00868     virtual void
00869     error(
00870             const XalanDOMString&   msg,
00871             const XalanNode*        sourceNode = 0,
00872             const XalanNode*        styleNode = 0) const;
00873 
00874     virtual void
00875     error(
00876             const XalanDOMString&   msg,
00877             const XalanNode*        sourceNode,
00878             const Locator*          locator) const;
00879 
00880     virtual void
00881     error(
00882             const char*         msg,
00883             const XalanNode*    sourceNode = 0,
00884             const XalanNode*    styleNode = 0) const;
00885 
00886     virtual void
00887     error(
00888             const char*         msg,
00889             const XalanNode*    sourceNode,
00890             const Locator*      locator) const;
00891 
00892     virtual void
00893     warn(
00894             const XalanDOMString&   msg,
00895             const XalanNode*        sourceNode = 0,
00896             const XalanNode*        styleNode = 0) const;
00897 
00898     virtual void
00899     warn(
00900             const XalanDOMString&   msg,
00901             const XalanNode*        sourceNode,
00902             const Locator*          locator) const;
00903 
00904     virtual void
00905     warn(
00906             const char*         msg,
00907             const XalanNode*    sourceNode = 0,
00908             const XalanNode*    styleNode = 0) const;
00909 
00910     virtual void
00911     warn(
00912             const char*         msg,
00913             const XalanNode*    sourceNode,
00914             const Locator*      locator) const;
00915 
00916     virtual void
00917     message(
00918             const XalanDOMString&   msg,
00919             const XalanNode*        sourceNode = 0,
00920             const XalanNode*        styleNode = 0) const;
00921 
00922     virtual void
00923     message(
00924             const XalanDOMString&   msg,
00925             const XalanNode*    sourceNode,
00926             const Locator*      locator) const;
00927 
00928     virtual void
00929     message(
00930             const char*         msg,
00931             const XalanNode*    sourceNode = 0,
00932             const XalanNode*    styleNode = 0) const;
00933 
00934     virtual void
00935     message(
00936             const char*         msg,
00937             const XalanNode*    sourceNode,
00938             const Locator*      locator) const;
00939 
00940 
00941     class XPathCacheReturnFunctor
00942     {
00943     public:
00944 
00945         XPathCacheReturnFunctor(XSLTEngineImpl&     xsltProcessor) :
00946             m_xsltProcessor(xsltProcessor)
00947         {
00948         }
00949 
00950         void
00951         operator()(const XPathCacheMapType::value_type&     theCacheEntry);
00952 
00953     private:
00954 
00955         XSLTEngineImpl&     m_xsltProcessor;
00956     };
00957 
00962     XalanSourceTreeDocument*
00963     getSourceTreeFactory() const;
00964 
00965 private:
00966 
00975     void
00976     getParams(
00977             const ElemTemplateElement&  xslCallTemplateElement,
00978             XalanNode*                  sourceNode,
00979             ParamsVectorType&           params);
00980 
00987     bool
00988     isCached(const XPath*   theXPath);
00989 
00993     void
00994     clearXPathCache();
00995 
01003     void
01004     addToXPathCache(
01005             const XalanDOMString&   pattern,
01006             const XPath*            theXPath);
01007 
01008 
01012     void
01013     cleanUpTransients();
01014 
01015     XPathExecutionContextDefault    m_xpathExecutionContextDefault;
01016 
01017     // $$ ToDo: Try to remove this dependency, and rely only on XSLTProcessor...
01018     XSLTEngineImpl*                 m_xsltProcessor;
01019 
01020     XalanNode*                      m_rootDocument;
01021 
01022     enum { eXPathCacheMax = 50,
01023            eDefaultParamsVectorSize = 10,
01024            eXResultTreeFragAllocatorBlockSize = 10,
01025            eResultTreeFragAllocatorBlockSize = 10,
01026            eDocumentFragmentAllocatorBlockSize = 10 };
01027 
01028     ElementRecursionStackType           m_elementRecursionStack;
01029 
01030     const PrefixResolver*               m_prefixResolver;
01031 
01032     const StylesheetRoot*               m_stylesheetRoot;
01033 
01034     FormatterListenerVectorType         m_formatterListeners;
01035 
01036     PrintWriterVectorType               m_printWriters;
01037 
01038     OutputStreamVectorType              m_outputStreams;
01039 
01040     const CollationCompareFunctor*      m_collationCompareFunctor;
01041 
01045     VariablesStack                      m_variablesStack;
01046 
01047     ParamsVectorType                    m_paramsVector;
01048 
01049     XPathCacheMapType                   m_matchPatternCache;
01050 
01051     KeyTablesTableType                  m_keyTables;
01052 
01053     KeyDeclarationSetType               m_keyDeclarationSet;
01054 
01055     CountersTable                       m_countersTable;
01056 
01057     // If true, we will not check HTML output for elements with
01058     // namespaces.  This is an optimization which can lead to
01059     // non-conforming behavior.
01060     bool                                m_ignoreHTMLElementNamespaces;
01061 
01066     mutable XalanAutoPtr<XalanSourceTreeDocument>   m_sourceTreeResultTreeFactory;
01067 
01068     // Holds the current mode.
01069     const XalanQName*                   m_mode;
01070 
01071     typedef XalanObjectCacheDefault<FormatterToText>        FormatterToTextCacheType;
01072     typedef XalanObjectCacheDefault<FormatterToSourceTree>  FormatterToSourceTreeCacheType;
01073     typedef XalanObjectCacheDefault<NodeSorter>             NodeSorterCacheType;
01074 
01075     FormatterToTextCacheType            m_formatterToTextCache;
01076 
01077     FormatterToSourceTreeCacheType      m_formatterToSourceTreeCache;
01078 
01079     NodeSorterCacheType                 m_nodeSorterCache;
01080 
01081     int                                 m_indentAmount;
01082 
01083     XResultTreeFragAllocator            m_xresultTreeFragAllocator;
01084 
01085     ResultTreeFragAllocator             m_resultTreeFragAllocator;
01086 
01087     XalanSourceTreeDocumentFragmentAllocator    m_documentFragmentAllocator;
01088 
01089     static XalanNumberFormatFactory     s_defaultXalanNumberFormatFactory;
01090 
01091     static XalanNumberFormatFactory*    s_xalanNumberFormatFactory;
01092 
01093     const static DefaultCollationCompareFunctor     s_defaultCollationFunctor;
01094 };
01095 
01096 
01097 
01098 #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.3
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.