00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999-2004 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 * 00057 * @author <a href="mailto:david_n_bertoni@lotus.com">David N. Bertoni</a> 00058 */ 00059 #if !defined(STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680) 00060 #define STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680 00061 00062 00063 00064 // Base include file. Must be first. 00065 #include <xalanc/XSLT/XSLTDefinitions.hpp> 00066 00067 00068 00069 #include <cstddef> 00070 #include <cstdio> 00071 #include <memory> 00072 00073 00074 00075 // Base class header file... 00076 #include <xalanc/XPath/XPathExecutionContext.hpp> 00077 00078 00079 00080 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00081 00082 00083 00084 // Base class header file... 00085 #include <xalanc/PlatformSupport/ExecutionContext.hpp> 00086 00087 00088 00089 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION) 00090 #include <xalanc/PlatformSupport/XalanNumberFormat.hpp> 00091 #endif 00092 00093 00094 00095 #include <xalanc/Include/XalanAutoPtr.hpp> 00096 00097 00098 00099 #include <xalanc/PlatformSupport/AttributeListImpl.hpp> 00100 #include <xalanc/PlatformSupport/XalanCollationServices.hpp> 00101 00102 00103 00104 #include <xalanc/XSLT/TopLevelArg.hpp> 00105 00106 00107 00108 XALAN_CPP_NAMESPACE_BEGIN 00109 00110 00111 00112 class CountersTable; 00113 class ElemTemplate; 00114 class ElemTemplateElement; 00115 class ElemVariable; 00116 class FormatterListener; 00117 class FormatterToText; 00118 class GenerateEvent; 00119 class KeyDeclaration; 00120 class PrefixResolver; 00121 class NodeRefListBase; 00122 class NodeSorter; 00123 class PrintWriter; 00124 class XalanQName; 00125 class SelectionEvent; 00126 class Stylesheet; 00127 class StylesheetRoot; 00128 class XalanOutputStream; 00129 class TracerEvent; 00130 class Writer; 00131 class XalanDocument; 00132 class XalanDocumentFragment; 00133 class XalanElement; 00134 class XalanNode; 00135 class XalanNumberFormat; 00136 class XPath; 00137 class XObject; 00138 class XObjectPtr; 00139 class XResultTreeFrag; 00140 00141 00142 00143 // 00144 // An abstract class which provides support for executing stylesheets. 00145 // 00146 class XALAN_XSLT_EXPORT StylesheetExecutionContext : public XPathExecutionContext 00147 { 00148 public: 00149 00150 #if defined(XALAN_NO_STD_NAMESPACE) 00151 typedef ostream StreamType; 00152 #else 00153 typedef std::ostream StreamType; 00154 #endif 00155 00156 typedef size_t size_type; 00157 00158 explicit 00159 StylesheetExecutionContext(XObjectFactory* theXObjectFactory = 0); 00160 00161 virtual 00162 ~StylesheetExecutionContext(); 00163 00164 // These interfaces are new... 00165 00173 virtual void 00174 error( 00175 const XalanDOMString& msg, 00176 const ElemTemplateElement& styleNode, 00177 const XalanNode* sourceNode = 0) const = 0; 00178 00186 virtual void 00187 error( 00188 const char* msg, 00189 const ElemTemplateElement& styleNode, 00190 const XalanNode* sourceNode = 0) const = 0; 00191 00199 virtual void 00200 warn( 00201 const XalanDOMString& msg, 00202 const ElemTemplateElement& styleNode, 00203 const XalanNode* sourceNode = 0) const = 0; 00204 00212 virtual void 00213 warn( 00214 const char* msg, 00215 const ElemTemplateElement& styleNode, 00216 const XalanNode* sourceNode = 0) const = 0; 00217 00225 virtual void 00226 message( 00227 const XalanDOMString& msg, 00228 const ElemTemplateElement& styleNode, 00229 const XalanNode* sourceNode = 0) const = 0; 00230 00231 00239 virtual void 00240 message( 00241 const char* msg, 00242 const ElemTemplateElement& styleNode, 00243 const XalanNode* sourceNode = 0) const = 0; 00244 00250 virtual bool 00251 getQuietConflictWarnings() const = 0; 00252 00259 virtual bool 00260 getCopyTextNodesOnly() const = 0; 00261 00268 virtual void 00269 setCopyTextNodesOnly(bool fValue) = 0; 00270 00271 /* 00272 * A class to manage setting and restoring the flag 00273 * for restricting copying only text nodes to the 00274 * result tree 00275 */ 00276 class SetAndRestoreCopyTextNodesOnly 00277 { 00278 public: 00279 00280 SetAndRestoreCopyTextNodesOnly( 00281 StylesheetExecutionContext& executionContext, 00282 bool fValue) : 00283 m_executionContext(executionContext), 00284 m_fValue(executionContext.getCopyTextNodesOnly()) 00285 { 00286 executionContext.setCopyTextNodesOnly(fValue); 00287 } 00288 00289 ~SetAndRestoreCopyTextNodesOnly() 00290 { 00291 m_executionContext.setCopyTextNodesOnly(m_fValue); 00292 } 00293 00294 private: 00295 00296 // Not implemented... 00297 SetAndRestoreCopyTextNodesOnly(const SetAndRestoreCopyTextNodesOnly&); 00298 00299 SetAndRestoreCopyTextNodesOnly& 00300 operator=(const SetAndRestoreCopyTextNodesOnly&); 00301 00302 // Data members... 00303 StylesheetExecutionContext& m_executionContext; 00304 00305 const bool m_fValue; 00306 }; 00307 00315 virtual XalanNode* 00316 getRootDocument() const = 0; 00317 00325 virtual void 00326 setRootDocument(XalanNode* theDocument) = 0; 00327 00333 virtual XalanDocument* 00334 createDocument() const = 0; 00335 00341 virtual void 00342 setStylesheetRoot(const StylesheetRoot* theStylesheet) = 0; 00343 00349 virtual const XalanQName* 00350 getCurrentMode() const = 0; 00351 00357 virtual void 00358 setCurrentMode(const XalanQName* theMode) = 0; 00359 00365 virtual const ElemTemplate* 00366 getCurrentTemplate() const = 0; 00367 00373 virtual void 00374 pushCurrentTemplate(const ElemTemplate* theTemplate) = 0; 00375 00376 virtual void 00377 popCurrentTemplate() = 0; 00378 00379 /* 00380 * A class to manage pushing and popping the current 00381 * template instance. 00382 */ 00383 class PushAndPopCurrentTemplate 00384 { 00385 public: 00386 00387 PushAndPopCurrentTemplate( 00388 StylesheetExecutionContext& executionContext, 00389 const ElemTemplate* theTemplate) : 00390 m_executionContext(executionContext) 00391 { 00392 executionContext.pushCurrentTemplate(theTemplate); 00393 } 00394 00395 ~PushAndPopCurrentTemplate() 00396 { 00397 m_executionContext.popCurrentTemplate(); 00398 } 00399 00400 private: 00401 00402 // Data members... 00403 StylesheetExecutionContext& m_executionContext; 00404 }; 00405 00411 virtual bool 00412 doDiagnosticsOutput() const = 0; 00413 00419 virtual void 00420 diag(const XalanDOMString& theString) = 0; 00421 00428 virtual void 00429 pushTime(const void* theKey) = 0; 00430 00437 virtual void 00438 displayDuration( 00439 const XalanDOMString& theMessage, 00440 const void* theKey) = 0; 00441 00445 virtual bool 00446 isElementPending() const = 0; 00447 00455 virtual void 00456 replacePendingAttribute( 00457 const XalanDOMChar* theName, 00458 const XalanDOMChar* theNewType, 00459 const XalanDOMChar* theNewValue) = 0; 00460 00466 virtual FormatterListener* 00467 getFormatterListener() const = 0; 00468 00474 virtual void 00475 setFormatterListener(FormatterListener* flistener) = 0; 00476 00477 virtual void 00478 pushOutputContext(FormatterListener* flistener = 0) = 0; 00479 00480 virtual void 00481 popOutputContext() = 0; 00482 00483 class OutputContextPushPop 00484 { 00485 public: 00486 00493 OutputContextPushPop( 00494 StylesheetExecutionContext& theExecutionContext, 00495 FormatterListener* theNewListener = 0) : 00496 m_executionContext(theExecutionContext) 00497 { 00498 m_executionContext.pushOutputContext(theNewListener); 00499 } 00500 00501 ~OutputContextPushPop() 00502 { 00503 m_executionContext.popOutputContext(); 00504 } 00505 00506 private: 00507 00508 StylesheetExecutionContext& m_executionContext; 00509 }; 00510 00517 virtual void 00518 addResultAttribute( 00519 const XalanDOMString& aname, 00520 const XalanDOMString& value) = 0; 00521 00528 virtual void 00529 addResultAttribute( 00530 const XalanDOMString& aname, 00531 const XalanDOMChar* value) = 0; 00532 00538 virtual void 00539 copyNamespaceAttributes(const XalanNode& src) = 0; 00540 00548 virtual const XalanDOMString* 00549 getResultPrefixForNamespace(const XalanDOMString& theNamespace) const = 0; 00550 00558 virtual const XalanDOMString* 00559 getResultNamespaceForPrefix(const XalanDOMString& thePrefix) const = 0; 00560 00569 virtual bool 00570 isPendingResultPrefix(const XalanDOMString& thePrefix) = 0; 00571 00577 virtual XalanDOMString 00578 getUniqueNamespaceValue() const = 0; 00579 00585 virtual void 00586 getUniqueNamespaceValue(XalanDOMString& theValue) const = 0; 00587 00593 virtual int 00594 getIndent() const = 0; 00595 00601 virtual void 00602 setIndent(int indentAmount) = 0; 00603 00612 virtual const XPath* 00613 createMatchPattern( 00614 const XalanDOMString& str, 00615 const PrefixResolver& resolver) = 0; 00616 00622 virtual void 00623 returnXPath(const XPath* xpath) = 0; 00624 00625 // A helper class to automatically return an XPath instance. 00626 class XPathGuard 00627 { 00628 public: 00629 00630 XPathGuard( 00631 StylesheetExecutionContext& context, 00632 const XPath* xpath = 0) : 00633 m_context(context), 00634 m_xpath(xpath) 00635 { 00636 } 00637 00638 ~XPathGuard() 00639 { 00640 if (m_xpath != 0) 00641 { 00642 m_context.returnXPath(m_xpath); 00643 } 00644 } 00645 00646 const XPath* 00647 get() const 00648 { 00649 return m_xpath; 00650 } 00651 00652 const XPath* 00653 release() 00654 { 00655 const XPath* const temp = m_xpath; 00656 00657 m_xpath = 0; 00658 00659 return temp; 00660 } 00661 00662 void 00663 reset(const XPath* xpath) 00664 { 00665 if (m_xpath != 0) 00666 { 00667 m_context.returnXPath(m_xpath); 00668 } 00669 00670 m_xpath = xpath; 00671 } 00672 00673 private: 00674 00675 StylesheetExecutionContext& m_context; 00676 00677 const XPath* m_xpath; 00678 }; 00679 00680 #if defined(XALAN_NO_STD_NAMESPACE) 00681 typedef vector<TopLevelArg> ParamVectorType; 00682 #else 00683 typedef std::vector<TopLevelArg> ParamVectorType; 00684 #endif 00685 00692 virtual void 00693 pushTopLevelVariables(const ParamVectorType& topLevelParams) = 0; 00694 00704 virtual const XObjectPtr 00705 createVariable( 00706 const XPath& xpath, 00707 XalanNode* contextNode, 00708 const PrefixResolver& resolver) = 0; 00709 00718 virtual const XObjectPtr 00719 createVariable( 00720 const ElemTemplateElement& templateChild, 00721 XalanNode* sourceNode) = 0; 00722 00735 virtual void 00736 pushVariable( 00737 const XalanQName& name, 00738 const ElemTemplateElement* element, 00739 const XalanDOMString& str, 00740 XalanNode* contextNode, 00741 const PrefixResolver& resolver) = 0; 00742 00754 virtual void 00755 pushVariable( 00756 const XalanQName& name, 00757 const ElemTemplateElement* element, 00758 const XPath& xpath, 00759 XalanNode* contextNode, 00760 const PrefixResolver& resolver) = 0; 00761 00771 virtual void 00772 pushVariable( 00773 const XalanQName& name, 00774 const ElemTemplateElement* element, 00775 const ElemTemplateElement& templateChild, 00776 XalanNode* sourceNode) = 0; 00777 00786 virtual void 00787 pushVariable( 00788 const XalanQName& name, 00789 const XObjectPtr val, 00790 const ElemTemplateElement* element) = 0; 00791 00800 virtual void 00801 pushVariable( 00802 const XalanQName& name, 00803 const ElemVariable* var, 00804 const ElemTemplateElement* element) = 0; 00805 00810 virtual void 00811 pushContextMarker() = 0; 00812 00816 virtual void 00817 popContextMarker() = 0; 00818 00819 /* 00820 * A class to manage pushing and popping an element's stack 00821 * frame context. 00822 */ 00823 class PushAndPopContextMarker 00824 { 00825 public: 00826 00827 PushAndPopContextMarker(StylesheetExecutionContext& executionContext) : 00828 m_executionContext(executionContext) 00829 { 00830 executionContext.pushContextMarker(); 00831 } 00832 00833 PushAndPopContextMarker( 00834 StylesheetExecutionContext& executionContext, 00835 int& currentStackFrameIndex) : 00836 m_executionContext(executionContext) 00837 { 00838 currentStackFrameIndex = executionContext.getCurrentStackFrameIndex(); 00839 00840 executionContext.pushContextMarker(); 00841 } 00842 00843 ~PushAndPopContextMarker() 00844 { 00845 m_executionContext.popContextMarker(); 00846 } 00847 00848 StylesheetExecutionContext& 00849 getExecutionContext() const 00850 { 00851 return m_executionContext; 00852 } 00853 00854 private: 00855 00856 StylesheetExecutionContext& m_executionContext; 00857 }; 00858 00862 virtual void 00863 resolveTopLevelParams() = 0; 00864 00868 virtual void 00869 clearTopLevelParams() = 0; 00870 00871 class ResolveAndClearTopLevelParams 00872 { 00873 public: 00874 00875 ResolveAndClearTopLevelParams(StylesheetExecutionContext& executionContext) : 00876 m_executionContext(executionContext) 00877 { 00878 m_executionContext.resolveTopLevelParams(); 00879 } 00880 00881 ~ResolveAndClearTopLevelParams() 00882 { 00883 m_executionContext.clearTopLevelParams(); 00884 } 00885 00886 private: 00887 00888 StylesheetExecutionContext& m_executionContext; 00889 }; 00890 00897 virtual void 00898 pushParams(const ElemTemplateElement& xslCallTemplateElement) = 0; 00899 00907 virtual const XObjectPtr 00908 getParamVariable(const XalanQName& theName) = 0; 00909 00915 virtual void 00916 pushElementFrame(const ElemTemplateElement* elem) = 0; 00917 00923 virtual void 00924 popElementFrame() = 0; 00925 00926 /* 00927 * A class to manage pushing and popping an element's stack 00928 * frame context. 00929 */ 00930 class PushAndPopElementFrame 00931 { 00932 public: 00933 00934 PushAndPopElementFrame( 00935 StylesheetExecutionContext& executionContext, 00936 const ElemTemplateElement* element) : 00937 m_executionContext(executionContext) 00938 { 00939 executionContext.pushElementFrame(element); 00940 } 00941 00942 ~PushAndPopElementFrame() 00943 { 00944 m_executionContext.popElementFrame(); 00945 } 00946 00947 private: 00948 00949 StylesheetExecutionContext& m_executionContext; 00950 }; 00951 00957 virtual int 00958 getGlobalStackFrameIndex() const = 0; 00959 00966 virtual int 00967 getCurrentStackFrameIndex() const = 0; 00968 00975 virtual void 00976 setCurrentStackFrameIndex(int currentStackFrameIndex = -1) = 0; 00977 00978 /* 00979 * A class to manage the state of the variable stacks frame index. 00980 */ 00981 class SetAndRestoreCurrentStackFrameIndex 00982 { 00983 public: 00984 00985 SetAndRestoreCurrentStackFrameIndex( 00986 StylesheetExecutionContext& executionContext, 00987 int newIndex) : 00988 m_executionContext(executionContext), 00989 m_savedIndex(executionContext.getCurrentStackFrameIndex()) 00990 { 00991 executionContext.setCurrentStackFrameIndex(newIndex); 00992 } 00993 00994 ~SetAndRestoreCurrentStackFrameIndex() 00995 { 00996 m_executionContext.setCurrentStackFrameIndex(m_savedIndex); 00997 } 00998 00999 private: 01000 01001 StylesheetExecutionContext& m_executionContext; 01002 01003 const int m_savedIndex; 01004 }; 01005 01006 /* 01007 * A class to manage stack state during execution. 01008 */ 01009 class ParamsPushPop : public PushAndPopContextMarker 01010 { 01011 public: 01012 01013 ParamsPushPop( 01014 StylesheetExecutionContext& executionContext, 01015 const ElemTemplateElement& xslCallTemplateElement) : 01016 PushAndPopContextMarker(executionContext) 01017 { 01018 doPush(xslCallTemplateElement); 01019 } 01020 01021 ParamsPushPop( 01022 StylesheetExecutionContext& executionContext, 01023 const ElemTemplateElement& xslCallTemplateElement, 01024 int& savedStackFrameIndex) : 01025 PushAndPopContextMarker(executionContext, savedStackFrameIndex) 01026 { 01027 doPush( 01028 xslCallTemplateElement, 01029 savedStackFrameIndex); 01030 } 01031 01032 ~ParamsPushPop() 01033 { 01034 } 01035 01036 private: 01037 01038 void 01039 doPush( 01040 const ElemTemplateElement& xslCallTemplateElement, 01041 int stackFrameIndex); 01042 01043 void 01044 doPush(const ElemTemplateElement& xslCallTemplateElement); 01045 }; 01046 01056 virtual void 01057 startDocument() = 0; 01058 01070 virtual void 01071 endDocument() = 0; 01072 01078 virtual void 01079 startElement(const XalanDOMChar* name) = 0; 01080 01086 virtual void 01087 endElement(const XalanDOMChar* name) = 0; 01088 01096 virtual void 01097 characters( 01098 const XalanDOMChar* ch, 01099 XalanDOMString::size_type start, 01100 XalanDOMString::size_type length) = 0; 01101 01111 virtual void 01112 charactersRaw( 01113 const XalanDOMChar* ch, 01114 XalanDOMString::size_type start, 01115 XalanDOMString::size_type length) = 0; 01116 01122 virtual void 01123 comment(const XalanDOMChar* data) = 0; 01124 01131 virtual void 01132 processingInstruction( 01133 const XalanDOMChar* target, 01134 const XalanDOMChar* data) = 0; 01135 01139 virtual void 01140 flushPending() = 0; 01141 01148 virtual void 01149 cloneToResultTree( 01150 const XalanNode& node, 01151 const LocatorType* locator) = 0; 01152 01163 virtual void 01164 cloneToResultTree( 01165 const XalanNode& node, 01166 XalanNode::NodeType nodeType, 01167 bool isLiteral, 01168 bool overrideStrip, 01169 bool shouldCloneAttributes, 01170 const LocatorType* locator) = 0; 01171 01179 virtual const XObjectPtr 01180 createXResultTreeFrag( 01181 const ElemTemplateElement& templateChild, 01182 XalanNode* sourceNode) = 0; 01183 01191 virtual void 01192 outputToResultTree( 01193 const XObject& xobj, 01194 const LocatorType* locator) = 0; 01195 01203 virtual void 01204 outputResultTreeFragment( 01205 const XObject& theTree, 01206 const LocatorType* locator) = 0; 01207 01213 virtual const XalanDOMString& 01214 getXSLNameSpaceURL() const = 0; 01215 01221 virtual const XalanDOMString& 01222 getXalanXSLNameSpaceURL() const = 0; 01223 01229 virtual bool 01230 findOnElementRecursionStack(const ElemTemplateElement* theElement) const = 0; 01231 01237 virtual void 01238 pushOnElementRecursionStack(const ElemTemplateElement* theElement) = 0; 01239 01245 virtual const ElemTemplateElement* 01246 popElementRecursionStack() = 0; 01247 01251 class ElementRecursionStackPusher 01252 { 01253 public: 01254 01261 ElementRecursionStackPusher( 01262 StylesheetExecutionContext& executionContext, 01263 const ElemTemplateElement* element) : 01264 m_executionContext(executionContext) 01265 { 01266 m_executionContext.pushOnElementRecursionStack(element); 01267 } 01268 01269 ~ElementRecursionStackPusher() 01270 { 01271 m_executionContext.popElementRecursionStack(); 01272 } 01273 01274 private: 01275 01276 StylesheetExecutionContext& m_executionContext; 01277 }; 01278 01279 01289 virtual bool 01290 returnXResultTreeFrag(XResultTreeFrag* theXResultTreeFrag) = 0; 01291 01292 01293 enum eDummy 01294 { 01295 eDefaultXMLIndentAmount = 0, 01296 eDefaultHTMLIndentAmount = 0 01297 }; 01298 01302 enum eEscapeURLs 01303 { 01304 eEscapeURLsDefault, // Use the value in the stylesheet 01305 eEscapeURLsNo, // Don't escape URLs 01306 eEscapeURLsYes // Escape URLs 01307 }; 01308 01316 virtual eEscapeURLs 01317 getEscapeURLs() const = 0; 01318 01326 virtual void 01327 setEscapeURLs(eEscapeURLs value) = 0; 01328 01329 01333 enum eOmitMETATag 01334 { 01335 eOmitMETATagDefault, // Use the value in the stylesheet 01336 eOmitMETATagNo, // Don't omit the META tag 01337 eOmitMETATagYes // Omit the META tag 01338 }; 01339 01347 virtual eOmitMETATag 01348 getOmitMETATag() const = 0; 01349 01357 virtual void 01358 setOmitMETATag(eOmitMETATag value) = 0; 01359 01380 virtual FormatterListener* 01381 createFormatterToXML( 01382 Writer& writer, 01383 const XalanDOMString& version = XalanDOMString(), 01384 bool doIndent = false, 01385 int indent = eDefaultXMLIndentAmount, 01386 const XalanDOMString& encoding = XalanDOMString(), 01387 const XalanDOMString& mediaType = XalanDOMString(), 01388 const XalanDOMString& doctypeSystem = XalanDOMString(), 01389 const XalanDOMString& doctypePublic = XalanDOMString(), 01390 bool xmlDecl = true, 01391 const XalanDOMString& standalone = XalanDOMString()) = 0; 01392 01410 virtual FormatterListener* 01411 createFormatterToHTML( 01412 Writer& writer, 01413 const XalanDOMString& encoding = XalanDOMString(), 01414 const XalanDOMString& mediaType = XalanDOMString(), 01415 const XalanDOMString& doctypeSystem = XalanDOMString(), 01416 const XalanDOMString& doctypePublic = XalanDOMString(), 01417 bool doIndent = true, 01418 int indent = eDefaultHTMLIndentAmount, 01419 bool escapeURLs = true, 01420 bool omitMetaTag = false) = 0; 01421 01428 virtual FormatterListener* 01429 createFormatterToText( 01430 Writer& writer, 01431 const XalanDOMString& encoding) = 0; 01432 01433 class BorrowReturnFormatterToText 01434 { 01435 public: 01436 01437 BorrowReturnFormatterToText( 01438 StylesheetExecutionContext& executionContext, 01439 Writer& writer, 01440 bool normalizeLinefeed = true, 01441 bool handleIgnorableWhitespace = true); 01442 01443 ~BorrowReturnFormatterToText() 01444 { 01445 assert(m_formatter != 0); 01446 01447 m_executionContext.returnFormatterToText(m_formatter); 01448 } 01449 01450 FormatterToText& 01451 operator*() const 01452 { 01453 assert(m_formatter != 0); 01454 01455 return *m_formatter; 01456 } 01457 01458 FormatterToText* 01459 get() const 01460 { 01461 assert(m_formatter != 0); 01462 01463 return m_formatter; 01464 } 01465 01466 FormatterToText* 01467 operator->() const 01468 { 01469 return get(); 01470 } 01471 01472 private: 01473 01474 StylesheetExecutionContext& m_executionContext; 01475 01476 FormatterToText* m_formatter; 01477 }; 01478 01479 01480 friend class BorrowReturnFormatterToText; 01481 01487 virtual NodeSorter* 01488 borrowNodeSorter() = 0; 01489 01496 virtual bool 01497 returnNodeSorter(NodeSorter* theSorter) = 0; 01498 01499 class BorrowReturnNodeSorter 01500 { 01501 public: 01502 01503 BorrowReturnNodeSorter(StylesheetExecutionContext& executionContext) : 01504 m_executionContext(executionContext), 01505 m_sorter(executionContext.borrowNodeSorter()) 01506 { 01507 assert(m_sorter != 0); 01508 } 01509 01510 ~BorrowReturnNodeSorter() 01511 { 01512 assert(m_sorter != 0); 01513 01514 m_executionContext.returnNodeSorter(m_sorter); 01515 } 01516 01517 NodeSorter& 01518 operator*() const 01519 { 01520 assert(m_sorter != 0); 01521 01522 return *m_sorter; 01523 } 01524 01525 NodeSorter* 01526 get() const 01527 { 01528 assert(m_sorter != 0); 01529 01530 return m_sorter; 01531 } 01532 01533 NodeSorter* 01534 operator->() const 01535 { 01536 return get(); 01537 } 01538 01539 private: 01540 01541 StylesheetExecutionContext& m_executionContext; 01542 01543 NodeSorter* m_sorter; 01544 }; 01545 01546 01547 typedef XalanAutoPtr<XalanNumberFormat> XalanNumberFormatAutoPtr; 01548 01555 virtual XalanNumberFormatAutoPtr 01556 createXalanNumberFormat() = 0; 01557 01558 01559 // Trace interface... 01560 01566 virtual size_type 01567 getTraceListeners() const = 0; 01568 01574 virtual void 01575 fireGenerateEvent(const GenerateEvent& ge) = 0; 01576 01582 virtual void 01583 fireTraceEvent(const TracerEvent& te) = 0; 01584 01590 virtual void 01591 fireSelectEvent(const SelectionEvent& se) = 0; 01592 01598 virtual bool 01599 getTraceSelects() const = 0; 01600 01608 virtual void 01609 traceSelect( 01610 const ElemTemplateElement& theStylesheetElement, 01611 const NodeRefListBase& nl, 01612 const XPath* xpath) = 0; 01613 01623 virtual int 01624 collationCompare( 01625 const XalanDOMString& theLHS, 01626 const XalanDOMString& theRHS, 01627 XalanCollationServices::eCaseOrder theCaseOrder = XalanCollationServices::eDefault) = 0; 01628 01639 virtual int 01640 collationCompare( 01641 const XalanDOMString& theLHS, 01642 const XalanDOMString& theRHS, 01643 const XalanDOMString& theLocale, 01644 XalanCollationServices::eCaseOrder theCaseOrder = XalanCollationServices::eDefault) = 0; 01645 01655 virtual int 01656 collationCompare( 01657 const XalanDOMChar* theLHS, 01658 const XalanDOMChar* theRHS, 01659 XalanCollationServices::eCaseOrder theCaseOrder = XalanCollationServices::eDefault) = 0; 01660 01671 virtual int 01672 collationCompare( 01673 const XalanDOMChar* theLHS, 01674 const XalanDOMChar* theRHS, 01675 const XalanDOMChar* theLocale, 01676 XalanCollationServices::eCaseOrder theCaseOrder = XalanCollationServices::eDefault) = 0; 01677 01684 virtual bool 01685 getInConstruction(const KeyDeclaration& keyDeclaration) const = 0; 01686 01692 virtual void 01693 beginConstruction(const KeyDeclaration& keyDeclaration) = 0; 01694 01700 virtual void 01701 endConstruction(const KeyDeclaration& keyDeclaration) = 0; 01702 01709 virtual PrintWriter* 01710 createPrintWriter(XalanOutputStream* theTextOutputStream) = 0; 01711 01720 virtual PrintWriter* 01721 createPrintWriter( 01722 const XalanDOMString& theFileName, 01723 const XalanDOMString& theEncoding) = 0; 01724 01731 virtual PrintWriter* 01732 createPrintWriter(StreamType& theStream) = 0; 01733 01740 virtual PrintWriter* 01741 createPrintWriter(FILE* theStream) = 0; 01742 01749 virtual CountersTable& 01750 getCountersTable() = 0; 01751 01757 virtual void 01758 characters(const XalanNode& node) = 0; 01759 01765 virtual void 01766 characters(const XObjectPtr& xobject) = 0; 01767 01774 virtual void 01775 charactersRaw(const XalanNode& node) = 0; 01776 01782 virtual void 01783 charactersRaw(const XObjectPtr& xobject) = 0; 01784 01785 01786 // These interfaces are inherited from XPathExecutionContext... 01787 01788 virtual void 01789 reset() = 0; 01790 01791 virtual XalanNode* 01792 getCurrentNode() const = 0; 01793 01794 virtual void 01795 pushCurrentNode(XalanNode* theCurrentNode) = 0; 01796 01797 virtual void 01798 popCurrentNode() = 0; 01799 01800 virtual bool 01801 isNodeAfter( 01802 const XalanNode& node1, 01803 const XalanNode& node2) const = 0; 01804 01805 virtual void 01806 pushContextNodeList(const NodeRefListBase& theList) = 0; 01807 01808 virtual void 01809 popContextNodeList() = 0; 01810 01811 virtual const NodeRefListBase& 01812 getContextNodeList() const = 0; 01813 01814 virtual size_type 01815 getContextNodeListLength() const = 0; 01816 01817 virtual size_type 01818 getContextNodeListPosition(const XalanNode& contextNode) const = 0; 01819 01827 virtual bool 01828 elementAvailable(const XalanQName& theQName) const = 0; 01829 01839 virtual bool 01840 elementAvailable( 01841 const XalanDOMString& theName, 01842 const LocatorType* locator) const = 0; 01843 01851 virtual bool 01852 functionAvailable(const XalanQName& theQName) const = 0; 01853 01862 virtual bool 01863 functionAvailable( 01864 const XalanDOMString& theName, 01865 const LocatorType* locator) const = 0; 01866 01867 virtual const XObjectPtr 01868 extFunction( 01869 const XalanDOMString& theNamespace, 01870 const XalanDOMString& functionName, 01871 XalanNode* context, 01872 const XObjectArgVectorType& argVec, 01873 const LocatorType* locator) = 0; 01874 01875 virtual XalanDocument* 01876 parseXML( 01877 const XalanDOMString& urlString, 01878 const XalanDOMString& base) const = 0; 01879 01880 virtual MutableNodeRefList* 01881 borrowMutableNodeRefList() = 0; 01882 01883 virtual bool 01884 returnMutableNodeRefList(MutableNodeRefList* theList) = 0; 01885 01886 virtual MutableNodeRefList* 01887 createMutableNodeRefList() const = 0; 01888 01889 virtual XalanDOMString& 01890 getCachedString() = 0; 01891 01892 virtual bool 01893 releaseCachedString(XalanDOMString& theString) = 0; 01894 01895 virtual void 01896 getNodeSetByKey( 01897 XalanDocument* doc, 01898 const XalanQName& qname, 01899 const XalanDOMString& ref, 01900 MutableNodeRefList& nodelist) = 0; 01901 01902 virtual void 01903 getNodeSetByKey( 01904 XalanDocument* doc, 01905 const XalanDOMString& name, 01906 const XalanDOMString& ref, 01907 const LocatorType* locator, 01908 MutableNodeRefList& nodelist) = 0; 01909 01910 virtual const XObjectPtr 01911 getVariable( 01912 const XalanQName& name, 01913 const LocatorType* locator = 0) = 0; 01914 01915 virtual const PrefixResolver* 01916 getPrefixResolver() const = 0; 01917 01918 virtual void 01919 setPrefixResolver(const PrefixResolver* thePrefixResolver) = 0; 01920 01921 virtual const XalanDOMString* 01922 getNamespaceForPrefix(const XalanDOMString& prefix) const = 0; 01923 01924 virtual XalanDOMString 01925 findURIFromDoc(const XalanDocument* owner) const = 0; 01926 01927 virtual const XalanDOMString& 01928 getUnparsedEntityURI( 01929 const XalanDOMString& theName, 01930 const XalanDocument& theDocument) const = 0; 01931 01932 virtual bool 01933 shouldStripSourceNode(const XalanNode& node) = 0; 01934 01935 virtual XalanDocument* 01936 getSourceDocument(const XalanDOMString& theURI) const = 0; 01937 01938 virtual void 01939 setSourceDocument( 01940 const XalanDOMString& theURI, 01941 XalanDocument* theDocument) = 0; 01942 01943 01944 virtual const XalanDecimalFormatSymbols* 01945 getDecimalFormatSymbols(const XalanQName& qname) = 0; 01946 01947 // These interfaces are inherited from ExecutionContext... 01948 01949 virtual void 01950 error( 01951 const XalanDOMString& msg, 01952 const XalanNode* sourceNode, 01953 const LocatorType* locator) const = 0; 01954 01955 virtual void 01956 error( 01957 const char* msg, 01958 const XalanNode* sourceNode, 01959 const LocatorType* locator) const = 0; 01960 01961 virtual void 01962 warn( 01963 const XalanDOMString& msg, 01964 const XalanNode* sourceNode = 0, 01965 const LocatorType* locator = 0) const = 0; 01966 01967 virtual void 01968 warn( 01969 const char* msg, 01970 const XalanNode* sourceNode = 0, 01971 const LocatorType* locator = 0) const = 0; 01972 01973 virtual void 01974 message( 01975 const XalanDOMString& msg, 01976 const XalanNode* sourceNode = 0, 01977 const LocatorType* locator = 0) const = 0; 01978 01979 virtual void 01980 message( 01981 const char* msg, 01982 const XalanNode* sourceNode = 0, 01983 const LocatorType* locator = 0) const = 0; 01984 01985 protected: 01986 01992 virtual FormatterToText* 01993 borrowFormatterToText() = 0; 01994 02001 virtual bool 02002 returnFormatterToText(FormatterToText* theFormatter) = 0; 02003 }; 02004 02005 02006 02007 XALAN_CPP_NAMESPACE_END 02008 02009 02010 02011 #endif // STYLESHEETEXECUTIONCONTEXT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.7 |
|