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 #if !defined(XALAN_XSLTENGINEIMPL_HEADER_GUARD) 00058 #define XALAN_XSLTENGINEIMPL_HEADER_GUARD 00059 00060 00061 00062 // Base include file. Must be first. 00063 #include "XSLTDefinitions.hpp" 00064 00065 00066 00067 // Base class 00068 #include "XSLTProcessor.hpp" 00069 00070 00071 00072 00073 // Standard library headers 00074 #include <cassert> 00075 #include <ctime> 00076 #include <map> 00077 #include <set> 00078 00079 00080 00081 #include <sax/DocumentHandler.hpp> 00082 00083 00084 00085 // XSL header files. 00086 #include <XalanDOM/XalanDOMString.hpp> 00087 00088 00089 00090 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION) 00091 #include <XPath/XPathProcessor.hpp> 00092 #endif 00093 00094 00095 00096 #include <PlatformSupport/AttributeListImpl.hpp> 00097 #include <PlatformSupport/DOMStringHelper.hpp> 00098 #include <PlatformSupport/XalanAutoPtr.hpp> 00099 00100 00101 00102 #include <XPath/Function.hpp> 00103 #include <XPath/NameSpace.hpp> 00104 00105 00106 00107 #include "KeyDeclaration.hpp" 00108 #include "ProblemListenerDefault.hpp" 00109 #include "StylesheetExecutionContext.hpp" 00110 #include "XSLTProcessorException.hpp" 00111 00112 00113 00114 // Forward definitions 00115 class DOMSupport; 00116 class GenerateEvent; 00117 class PrintWriter; 00118 class ResultTreeFragBase; 00119 class StylesheetConstructionContext; 00120 class StylesheetExecutionContext; 00121 class StylesheetRoot; 00122 class XalanAttr; 00123 class XalanText; 00124 class XLocator; 00125 class XMLParserLiaison; 00126 class XMLURL; 00127 class XObject; 00128 class XPathEnvSupport; 00129 class XPathFactory; 00130 class XPathProcessor; 00131 class XPathSupport; 00132 class XSLTResultTarget; 00133 00134 00135 00147 00148 class XALAN_XSLT_EXPORT XSLTEngineImpl : public XSLTProcessor, private DocumentHandler 00149 { 00150 public: 00151 00152 #if defined(XALAN_NO_NAMESPACES) 00153 typedef map<XalanDOMString, 00154 int, 00155 less<XalanDOMString> > AttributeKeysMapType; 00156 typedef map<XalanDOMString, 00157 int, 00158 less<XalanDOMString> > ElementKeysMapType; 00159 typedef map<const void*, 00160 clock_t, 00161 less<const void*> > DurationsTableMapType; 00162 typedef vector<const Locator*> LocatorStack; 00163 typedef vector<NameSpace> NamespaceVectorType; 00164 typedef vector<NamespaceVectorType> NamespacesStackType; 00165 typedef vector<TraceListener*> TraceListenerVectorType; 00166 typedef vector<bool> BoolVectorType; 00167 #else 00168 typedef std::map<XalanDOMString, int> AttributeKeysMapType; 00169 typedef std::map<XalanDOMString, int> ElementKeysMapType; 00170 typedef std::map<const void*, clock_t> DurationsTableMapType; 00171 typedef std::vector<const Locator*> LocatorStack; 00172 typedef std::vector<NameSpace> NamespaceVectorType; 00173 typedef std::vector<NamespaceVectorType> NamespacesStackType; 00174 typedef std::vector<TraceListener*> TraceListenerVectorType; 00175 typedef std::vector<bool> BoolVectorType; 00176 #endif 00177 00178 typedef XalanAutoPtr<XPathProcessor> XPathProcessorPtrType; 00179 typedef Function::XObjectArgVectorType XObjectArgVectorType; 00180 typedef StylesheetExecutionContext::ParamVectorType ParamVectorType; 00181 00182 // Public members 00183 //--------------------------------------------------------------------- 00184 00197 XSLTEngineImpl( 00198 XMLParserLiaison& parserLiaison, 00199 XPathSupport& xpathSupport, 00200 XPathEnvSupport& xpathEnvSupport, 00201 DOMSupport& domSupport, 00202 XObjectFactory& xobjectFactory, 00203 XPathFactory& xpathFactory); 00204 00205 virtual ~XSLTEngineImpl(); 00206 00211 static void 00212 initialize(); 00213 00217 static void 00218 terminate(); 00219 00220 // These methods are inherited from XSLTProcessor ... 00221 00222 virtual void 00223 process( 00224 XSLTInputSource& inputSource, 00225 XSLTInputSource& stylesheetSource, 00226 XSLTResultTarget& outputTarget, 00227 StylesheetConstructionContext& constructionContext, 00228 StylesheetExecutionContext& executionContext); 00229 00230 virtual void 00231 process( 00232 XSLTInputSource& inputSource, 00233 XSLTResultTarget& outputTarget, 00234 StylesheetExecutionContext& executionContext); 00235 00236 virtual StylesheetRoot* 00237 processStylesheet( 00238 XSLTInputSource& stylesheetSource, 00239 StylesheetConstructionContext& constructionContext); 00240 00241 virtual StylesheetRoot* 00242 processStylesheet( 00243 const XalanDOMString& xsldocURLString, 00244 StylesheetConstructionContext& constructionContext); 00245 00246 virtual XalanNode* 00247 getSourceTreeFromInput(XSLTInputSource& inputSource); 00248 00249 virtual void 00250 outputToResultTree( 00251 StylesheetExecutionContext& executionContext, 00252 const XObject& xobj); 00253 00254 virtual void 00255 resetCurrentState( 00256 XalanNode* sourceTree, 00257 XalanNode* xmlNode); 00258 00259 virtual XalanDOMString 00260 evaluateAttrVal( 00261 XalanNode* contextNode, 00262 const PrefixResolver& namespaceContext, 00263 const XalanDOMString& stringedValue, 00264 XPathExecutionContext& executionContext); 00265 00266 virtual ResultTreeFragBase* 00267 createResultTreeFrag( 00268 StylesheetExecutionContext& executionContext, 00269 const ElemTemplateElement& templateChild, 00270 XalanNode* sourceTree, 00271 XalanNode* sourceNode, 00272 const QName& mode); 00273 00274 virtual ResultTreeFragBase* 00275 createResultTreeFrag() const; 00276 00277 virtual void 00278 resolveTopLevelParams(StylesheetExecutionContext& executionContext); 00279 00280 virtual XMLParserLiaison& 00281 getXMLParserLiaison() const; 00282 00283 virtual const XalanDOMString 00284 getUniqueNSValue() const; 00285 00286 virtual void 00287 setStylesheetParam( 00288 const XalanDOMString& key, 00289 const XalanDOMString& expression); 00290 00291 virtual void 00292 setStylesheetParam( 00293 const XalanDOMString& key, 00294 XObject* value); 00295 00296 virtual bool 00297 shouldStripSourceNode( 00298 XPathExecutionContext& executionContext, 00299 const XalanNode& node) const; 00300 00301 virtual FormatterListener* 00302 getFormatterListener() const; 00303 00304 virtual void 00305 setFormatterListener(FormatterListener* flistener); 00306 00307 // Trace-related functions... 00308 00309 virtual unsigned long 00310 getTraceListeners() const; 00311 00312 virtual void 00313 addTraceListener(TraceListener* tl); 00314 00315 virtual void 00316 removeTraceListener(TraceListener* tl); 00317 00318 virtual void 00319 fireGenerateEvent(const GenerateEvent& ge); 00320 00321 virtual void 00322 fireTraceEvent(const TracerEvent& te); 00323 00324 virtual void 00325 fireSelectEvent(const SelectionEvent& se); 00326 00327 virtual bool 00328 getTraceSelects() const; 00329 00330 virtual void 00331 setTraceSelects(bool b); 00332 00333 virtual void 00334 traceSelect( 00335 const XalanElement& theTemplate, 00336 const NodeRefListBase& nl) const; 00337 00338 virtual void 00339 setQuietConflictWarnings(bool b); 00340 00341 virtual void 00342 setDiagnosticsOutput(PrintWriter* pw); 00343 00344 00356 XalanDocument* 00357 parseXML( 00358 const XalanDOMString& urlString, 00359 DocumentHandler* docHandler, 00360 XalanDocument* docToRegister); 00361 00374 Stylesheet* 00375 getStylesheetFromPIURL( 00376 const XalanDOMString& xslURLString, 00377 XalanNode& fragBase, 00378 const XalanDOMString& xmlBaseIdent, 00379 bool isRoot, 00380 StylesheetConstructionContext& constructionContext); 00381 00385 void 00386 flushPending(); 00387 00394 void 00395 addResultNamespaceDecl( 00396 const XalanDOMString& prefix, 00397 const XalanDOMString& namespaceVal); 00398 00407 void 00408 addResultAttribute( 00409 AttributeListImpl& attList, 00410 const XalanDOMString& aname, 00411 const XalanDOMString& value); 00412 00420 void 00421 addResultAttribute( 00422 const XalanDOMString& aname, 00423 const XalanDOMString& value) 00424 { 00425 addResultAttribute(m_pendingAttributes, 00426 aname, 00427 value); 00428 } 00429 00454 virtual void 00455 characters( 00456 const XMLCh* const ch, 00457 const unsigned int start, 00458 const unsigned int length); 00459 00467 virtual void 00468 startElement( 00469 const XMLCh* const name); 00470 00481 virtual void 00482 charactersRaw( 00483 const XMLCh* const ch, 00484 const unsigned int start, 00485 const unsigned int length); 00486 00493 virtual void 00494 comment( 00495 const XMLCh* const data); 00496 00503 virtual void 00504 entityReference( 00505 const XMLCh* const data); 00506 00529 virtual void 00530 cdata( 00531 const XMLCh* const ch, 00532 const unsigned int start, 00533 const unsigned int length); 00534 00543 void 00544 cloneToResultTree( 00545 XalanNode& node, 00546 bool isLiteral, 00547 bool overrideStrip, 00548 bool shouldCloneAttributes); 00549 00556 void 00557 outputResultTreeFragment( 00558 StylesheetExecutionContext& executionContext, 00559 const XObject& theTree); 00560 00566 virtual const StylesheetRoot* 00567 getStylesheetRoot() const; 00568 00574 virtual void 00575 setStylesheetRoot(const StylesheetRoot* theStylesheet); 00576 00582 virtual void 00583 setExecutionContext(StylesheetExecutionContext* theExecutionContext); 00584 00591 static const XalanDOMString& 00592 getXSLNameSpaceURL() 00593 { 00594 return s_XSLNameSpaceURL; 00595 } 00596 00602 static const XalanDOMString& 00603 getXalanXSLNameSpaceURL() 00604 { 00605 return s_XSLT4JNameSpaceURL; 00606 } 00607 00613 static double 00614 getXSLTVerSupported(); 00615 00621 static const AttributeKeysMapType& 00622 getAttributeKeys() 00623 { 00624 return s_attributeKeys; 00625 } 00626 00632 static const ElementKeysMapType& 00633 getElementKeys() 00634 { 00635 return s_elementKeys; 00636 } 00637 00646 static int 00647 getElementToken(const XalanDOMString& name) 00648 { 00649 AttributeKeysMapType::const_iterator iter= 00650 s_elementKeys.find(name); 00651 00652 return iter == s_elementKeys.end() ? -2 : (*iter).second; 00653 } 00654 00663 static int 00664 getAttrTok(const XalanDOMString& name) 00665 { 00666 AttributeKeysMapType::const_iterator iter= 00667 s_attributeKeys.find(name); 00668 00669 return iter == s_attributeKeys.end() ? -2 : (*iter).second; 00670 } 00671 00681 int 00682 getXSLToken(const XalanNode& node) const; 00683 00691 bool 00692 isXSLTagOfType( 00693 const XalanNode& node, 00694 int tagType) const; 00695 00701 bool 00702 getQuietConflictWarnings() const 00703 { 00704 return m_quietConflictWarnings; 00705 } 00706 00707 virtual void 00708 message( 00709 const XalanDOMString& msg, 00710 const XalanNode* styleNode = 0, 00711 const XalanNode* sourceNode = 0) const; 00712 00721 virtual void 00722 warn( 00723 const XalanDOMString& msg, 00724 const XalanNode* styleNode = 0, 00725 const XalanNode* sourceNode = 0) const; 00726 00735 virtual void 00736 error( 00737 const XalanDOMString& msg, 00738 const XalanNode* styleNode = 0, 00739 const XalanNode* sourceNode = 0) const; 00740 00747 void 00748 pushTime(const void* key) const; 00749 00756 clock_t 00757 popDuration(const void* key) const; 00758 00766 void 00767 displayDuration( 00768 const XalanDOMString& info, 00769 const void* key) const; 00770 00771 00777 bool doDiagnosticsOutput() 00778 { return 0 != m_diagnosticsPrintWriter; } 00779 00785 void 00786 diag(const XalanDOMString& s) const; 00787 00795 bool 00796 isCDataResultElem(const XalanDOMString& elementName) const; 00797 00805 bool 00806 qnameEqualsResultElemName( 00807 const QName& qname, 00808 const XalanDOMString& elementName) const; 00809 00816 const XalanDOMString& 00817 getResultNamespaceForPrefix(const XalanDOMString& prefix) const; 00818 00825 const XalanDOMString& 00826 getResultPrefixForNamespace(const XalanDOMString& theNamespace) const; 00827 00836 double 00837 evalMatchPatternStr( 00838 const XalanDOMString& str, 00839 XalanNode* context, 00840 XPathExecutionContext& executionContext); 00841 00849 const XPath* 00850 createMatchPattern( 00851 const XalanDOMString& str, 00852 const PrefixResolver& resolver); 00853 00860 void 00861 returnXPath(const XPath* xpath); 00862 00869 void 00870 copyNamespaceAttributes( 00871 const XalanNode& src, 00872 bool srcIsStylesheetTree); 00873 00881 const XObject* 00882 evalXPathStr( 00883 const XalanDOMString& str, 00884 XPathExecutionContext& executionContext); 00885 00895 const XObject* 00896 evalXPathStr( 00897 const XalanDOMString& str, 00898 XalanNode* contextNode, 00899 const PrefixResolver& prefixResolver, 00900 XPathExecutionContext& executionContext); 00901 00911 const XObject* 00912 evalXPathStr( 00913 const XalanDOMString& str, 00914 XalanNode* contextNode, 00915 const XalanElement& prefixResolver, 00916 XPathExecutionContext& executionContext); 00917 00925 XalanElement* 00926 getElementByID( 00927 const XalanDOMString& id, 00928 const XalanDocument& doc) const; 00929 00938 XalanDOMString 00939 getAttrVal( 00940 const XalanElement& el, 00941 const XalanDOMString& key, 00942 const XalanNode& contextNode); 00943 00951 static XalanDOMString 00952 getAttrVal( 00953 const XalanElement& el, 00954 const XalanDOMString& key); 00955 00967 void 00968 copyAttributeToTarget( 00969 const XalanAttr& attr, 00970 XalanNode* contextNode, 00971 const Stylesheet* stylesheetTree, 00972 AttributeListImpl& attrList, 00973 const XalanElement& namespaceContext); 00974 00981 bool 00982 getStripWhiteSpace() const 00983 { 00984 return m_stripWhiteSpace; 00985 } 00986 00993 void 00994 setStripWhiteSpace(bool fStrip) 00995 { 00996 m_stripWhiteSpace = fStrip; 00997 } 00998 01014 XalanDOMString fixWhiteSpace( 01015 const XalanDOMString& string, 01016 bool trimHead, 01017 bool trimTail, 01018 bool doublePunctuationSpaces); 01019 01026 void setOutputCarriageReturns(bool b) 01027 { 01028 m_outputCarriageReturns = b; 01029 } 01030 01037 void 01038 setOutputLinefeeds(bool b) 01039 { 01040 m_outputLinefeeds = b; 01041 } 01042 01050 /* $$$ ToDo: This should almost certainly be done somewhere else... like in the XML 01051 * parser. 01052 */ 01053 const XalanDOMString 01054 getNormalizedText(const XalanText& tx) const; 01055 01061 XPathFactory& 01062 getXPathFactory() 01063 { 01064 return m_xpathFactory; 01065 } 01066 01072 XPathProcessor& 01073 getXPathProcessor() 01074 { 01075 return *m_xpathProcessor.get(); 01076 } 01077 01082 virtual void 01083 reset(); 01084 01090 XPathSupport& 01091 getXPathSupport() 01092 { 01093 return m_xpathSupport; 01094 } 01095 01101 XPathEnvSupport& 01102 getXPathEnvSupport() 01103 { 01104 return m_xpathEnvSupport; 01105 } 01106 01115 void 01116 setProblemListener(ProblemListener* l) 01117 { 01118 m_problemListener = l; 01119 } 01120 01129 ProblemListener* 01130 getProblemListener() const 01131 { 01132 return m_problemListener; 01133 } 01134 01135 /* 01136 * See if there is a pending start document event waiting. 01137 * @return true if there is a start document event waiting. 01138 */ 01139 bool 01140 getHasPendingStartDocument() const 01141 { 01142 return m_hasPendingStartDocument; 01143 } 01144 01145 /* 01146 * Set the pending start document event state. 01147 * @param the new value 01148 */ 01149 void 01150 setHasPendingStartDocument(bool b) 01151 { 01152 m_hasPendingStartDocument = b; 01153 } 01154 01155 /* 01156 * See if a pending start document event must be flushed. 01157 * @return true if the event must be flushed. 01158 */ 01159 bool 01160 getMustFlushPendingStartDocument() const 01161 { 01162 return m_mustFlushStartDocument; 01163 } 01164 01165 /* 01166 * Set the pending start document event flush state. 01167 * @param the new value 01168 */ 01169 void 01170 setMustFlushPendingStartDocument(bool b) 01171 { 01172 m_hasPendingStartDocument = b; 01173 } 01174 01180 ResultTreeFragBase* 01181 createDocFrag() const; 01182 01188 AttributeListImpl& 01189 getPendingAttributes(); 01190 01196 const XalanDOMString 01197 getPendingElementName() const; 01198 01204 void 01205 setPendingAttributes(const AttributeList& pendingAttributes); 01206 01212 void 01213 setPendingElementName(const XalanDOMString& elementName); 01214 01220 const Locator* 01221 getLocatorFromStack() const 01222 { 01223 return m_stylesheetLocatorStack.size() == 0 ? 0 : m_stylesheetLocatorStack.back(); 01224 } 01225 01231 void 01232 pushLocatorOnStack(const Locator* locator) 01233 { 01234 m_stylesheetLocatorStack.push_back(locator); 01235 } 01236 01240 void 01241 popLocatorStack() 01242 { 01243 if (m_stylesheetLocatorStack.size() != 0) 01244 { 01245 m_stylesheetLocatorStack.pop_back(); 01246 } 01247 } 01248 01249 // These methods are inherited from DocumentHandler ... 01250 01251 virtual void 01252 setDocumentLocator(const Locator* const locator); 01253 01254 virtual void 01255 startDocument(); 01256 01257 virtual void 01258 endDocument(); 01259 01260 virtual void 01261 startElement( 01262 const XMLCh* const name, 01263 AttributeList& atts); 01264 01265 virtual void 01266 endElement( 01267 const XMLCh* const name); 01268 01269 virtual void characters ( 01270 const XMLCh* const chars, 01271 const unsigned int length); 01272 01273 virtual void 01274 ignorableWhitespace( 01275 const XMLCh* const ch, 01276 const unsigned int length); 01277 01278 virtual void 01279 processingInstruction( 01280 const XMLCh* const target, 01281 const XMLCh* const data); 01282 01283 virtual void 01284 resetDocument(); 01285 01286 protected: 01287 01291 bool m_outputCarriageReturns; 01292 01296 bool m_outputLinefeeds; 01297 01301 mutable XalanDocument* m_resultTreeFactory; 01302 01309 XalanDOMString m_resultNameSpacePrefix; 01310 01314 XalanDOMString m_resultNameSpaceURL; 01315 01316 01317 /* 01318 * The current input element that is being processed. 01319 */ 01320 XalanNode* m_currentNode; 01321 01327 static XalanElement* 01328 findElementByAttribute( 01329 XalanElement& elem, 01330 const XalanDOMString& targetElementName, 01331 const XalanDOMString& targetAttributeName, 01332 const XalanDOMString& targetAttributeValue); 01333 01341 void 01342 copyAttributesToAttList( 01343 XalanNode* contextNode, 01344 const Stylesheet* stylesheetTree, 01345 const XalanElement& templateChild, 01346 AttributeListImpl& attList); 01347 01355 01356 XalanDOMString m_pendingElementName; 01357 01365 AttributeListImpl m_pendingAttributes; 01366 01367 /* 01368 * true if a startDocument() event has been fired, but we 01369 * haven't yet calld startDocument() on our formatter. 01370 */ 01371 bool m_hasPendingStartDocument; 01372 01373 /* 01374 * true if a pending startDocument() must be flushed. 01375 */ 01376 bool m_mustFlushStartDocument; 01377 01382 01386 NamespacesStackType m_resultNameSpaces; 01387 01393 NameSpace m_emptyNamespace; 01394 01395 // Factory for creating xpaths. 01396 XPathFactory& m_xpathFactory; 01397 01398 // Factory for creating xobjects 01399 XObjectFactory& m_xobjectFactory; 01400 01401 // The query/pattern-matcher object. 01402 XPathProcessorPtrType m_xpathProcessor; 01403 01409 BoolVectorType m_cdataStack; 01410 01411 private: 01412 01413 01418 bool 01419 pendingAttributesHasDefaultNS() const; 01420 01425 LocatorStack m_stylesheetLocatorStack; 01426 01433 ProblemListenerDefault m_defaultProblemListener; 01434 01435 ProblemListener* m_problemListener; 01436 01440 const StylesheetRoot* m_stylesheetRoot; 01441 01445 static const XalanDOMString& s_XSLNameSpaceURL; //"http://www.w3.org/1999/XSL/Transform" 01446 01450 static const double s_XSLTVerSupported; // 1.0 01451 01455 static const XalanDOMString& s_XSLT4JNameSpaceURL; // "http://xml.apache.org/xslt" 01456 01460 static const XalanDOMString& s_uniqueNamespacePrefix; 01461 01465 static const ElementKeysMapType& s_XSLT4JElementKeys; 01466 01470 static const AttributeKeysMapType& s_attributeKeys; 01471 01475 static const ElementKeysMapType& s_elementKeys; 01476 01480 bool m_traceSelects; 01481 01486 bool m_quietConflictWarnings; 01487 01488 /* 01489 * A stream to print diagnostics to. 01490 */ 01491 PrintWriter* m_diagnosticsPrintWriter; 01492 01493 /* For diagnostics */ 01494 mutable DurationsTableMapType m_durationsTable; 01495 01500 TraceListenerVectorType m_traceListeners; 01501 01502 // Common processing for errors and warnings 01503 void 01504 problem( 01505 const XalanDOMString& msg, 01506 ProblemListener::eClassification classification, 01507 const XalanNode* styleNode = 0, 01508 const XalanNode* sourceNode = 0) const; 01509 01510 01511 //========================================================== 01512 // SECTION: Function to do with attribute handling 01513 //========================================================== 01514 01518 mutable unsigned long m_uniqueNSValue; // 0 01519 01523 XalanDOMString 01524 getPrefixForNamespace( 01525 const XalanDOMString& theNamespace, 01526 const XalanElement& namespaceContext) const; 01527 01532 void 01533 translateCSSAttrsToStyleAttr(AttributeListImpl& attList); 01534 01542 XLocator* 01543 getXLocatorFromNode(const XalanNode* node) const; 01544 01552 void 01553 associateXLocatorToNode( 01554 const XalanNode* node, 01555 XLocator* xlocator); 01556 01562 bool m_stripWhiteSpace; // default default-space="preserve" 01563 01577 static const bool s_resolveContentsEarly; 01578 01583 virtual XalanDocument* 01584 getDOMFactory() const; 01585 01586 bool 01587 getResolveContentsEarly() const 01588 { 01589 return s_resolveContentsEarly; 01590 } 01591 01592 ParamVectorType m_topLevelParams; 01593 01594 public: 01595 01599 void 01600 clearTopLevelParams() 01601 { 01602 m_topLevelParams.clear(); 01603 } 01604 01609 XalanNode* 01610 getSourceNode() const 01611 { 01612 return m_currentNode; 01613 } 01614 01620 XMLParserLiaison& m_parserLiaison; 01621 01622 XPathSupport& m_xpathSupport; 01623 01624 XPathEnvSupport& m_xpathEnvSupport; 01625 01626 DOMSupport& m_domSupport; 01627 01632 FormatterListener* m_flistener; 01633 01638 MutableNodeRefList m_contextNodeList; 01639 01643 StylesheetExecutionContext* m_executionContext; 01644 01645 01646 static void 01647 installFunctions(); 01648 01649 static void 01650 uninstallFunctions(); 01651 01652 static void 01653 initializeAttributeKeysTable(AttributeKeysMapType& theAttributeKeys); 01654 01655 static void 01656 initializeElementKeysTable(ElementKeysMapType& theElementKeys); 01657 01658 static void 01659 initializeXSLT4JElementKeys(ElementKeysMapType& theElementKeys); 01660 }; 01661 01662 01663 01664 #endif // XALAN_XSLTENGINEIMPL_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.0 |
|