You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/10/19 20:42:23 UTC

cvs commit: xml-xalan/c/src/XSLT StylesheetExecutionContext.hpp StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp XSLTProcessor.hpp XSLTProcessorEnvSupport.hpp XSLTProcessorEnvSupportDefault.cpp XSLTProcessorEnvSupportDefault.hpp

dbertoni    01/10/19 11:42:23

  Modified:    c/src/XSLT StylesheetExecutionContext.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        XSLTEngineImpl.cpp XSLTEngineImpl.hpp
                        XSLTProcessor.hpp XSLTProcessorEnvSupport.hpp
                        XSLTProcessorEnvSupportDefault.cpp
                        XSLTProcessorEnvSupportDefault.hpp
  Log:
  Initial changes to fix problems with RTFs.
  
  Revision  Changes    Path
  1.66      +0 -3      xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp
  
  Index: StylesheetExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContext.hpp,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- StylesheetExecutionContext.hpp	2001/09/28 18:27:59	1.65
  +++ StylesheetExecutionContext.hpp	2001/10/19 18:42:23	1.66
  @@ -1628,9 +1628,6 @@
   	virtual XalanDOMString
   	findURIFromDoc(const XalanDocument*		owner) const = 0;
   
  -	virtual XalanDocument*
  -	getDOMFactory() const = 0;
  -
   	virtual const XalanDOMString&
   	getUnparsedEntityURI(
   			const XalanDOMString&	theName,
  
  
  
  1.77      +11 -14    xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- StylesheetExecutionContextDefault.cpp	2001/09/26 21:30:23	1.76
  +++ StylesheetExecutionContextDefault.cpp	2001/10/19 18:42:23	1.77
  @@ -152,7 +152,8 @@
   	m_mode(0),
   	m_formatterToTextCache(),
   	m_formatterToSourceTreeCache(),
  -	m_nodeSorterCache()
  +	m_nodeSorterCache(),
  +	m_resultTreeFragCache(eResultTreeFragCacheListSize)
   {
   }
   
  @@ -185,7 +186,8 @@
   	m_mode(0),
   	m_formatterToTextCache(),
   	m_formatterToSourceTreeCache(),
  -	m_nodeSorterCache()
  +	m_nodeSorterCache(),
  +	m_resultTreeFragCache(eResultTreeFragCacheListSize)
   {
   }
   
  @@ -937,7 +939,7 @@
   {
   	assert(m_xsltProcessor != 0);
   
  -	m_xsltProcessor->outputToResultTree(*this, xobj);
  +	m_xsltProcessor->outputToResultTree(xobj);
   }
   
   
  @@ -947,7 +949,7 @@
   {
   	assert(m_xsltProcessor != 0);
   
  -	m_xsltProcessor->outputResultTreeFragment(*this, theTree);
  +	m_xsltProcessor->outputResultTreeFragment(theTree);
   }
   
   
  @@ -1424,6 +1426,9 @@
   	m_mode = 0;
   
   	m_formatterToTextCache.reset();
  +	m_formatterToSourceTreeCache.reset();
  +	m_nodeSorterCache.reset();
  +	m_resultTreeFragCache.reset(),
   
   	// Just in case endDocument() was not called,
   	// clean things up...
  @@ -1580,7 +1585,7 @@
   ResultTreeFragBase*
   StylesheetExecutionContextDefault::borrowResultTreeFrag()
   {
  -	return m_xpathExecutionContextDefault.borrowResultTreeFrag();
  +	return m_resultTreeFragCache.get();
   }
   
   
  @@ -1588,7 +1593,7 @@
   bool
   StylesheetExecutionContextDefault::returnResultTreeFrag(ResultTreeFragBase*		theResultTreeFragBase)
   {
  -	return m_xpathExecutionContextDefault.returnResultTreeFrag(theResultTreeFragBase);
  +	return m_resultTreeFragCache.release(theResultTreeFragBase);
   }
   
   
  @@ -1681,14 +1686,6 @@
   StylesheetExecutionContextDefault::getNamespaceForPrefix(const XalanDOMString&	prefix) const
   {
   	return m_xpathExecutionContextDefault.getNamespaceForPrefix(prefix);
  -}
  -
  -
  -
  -XalanDocument*
  -StylesheetExecutionContextDefault::getDOMFactory() const
  -{
  -	return m_xpathExecutionContextDefault.getDOMFactory();
   }
   
   
  
  
  
  1.69      +6 -4      xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- StylesheetExecutionContextDefault.hpp	2001/09/26 21:30:23	1.68
  +++ StylesheetExecutionContextDefault.hpp	2001/10/19 18:42:23	1.69
  @@ -78,6 +78,7 @@
   
   
   
  +#include <XPath/ResultTreeFrag.hpp>
   #include <XPath/XPathExecutionContextDefault.hpp>
   
   
  @@ -834,9 +835,6 @@
   	virtual XalanDOMString
   	findURIFromDoc(const XalanDocument*		owner) const;
   
  -	virtual XalanDocument*
  -	getDOMFactory() const;
  -
   	virtual const XalanDOMString&
   	getUnparsedEntityURI(
   			const XalanDOMString&	theName,
  @@ -1017,7 +1015,8 @@
   	XalanNode*						m_rootDocument;
   
   	enum { eXPathCacheMax = 50,
  -		   eDefaultParamsVectorSize = 10 };
  +		   eDefaultParamsVectorSize = 10,
  + 		   eResultTreeFragCacheListSize = 50 };
   
   	ElementRecursionStackType			m_elementRecursionStack;
   
  @@ -1065,12 +1064,15 @@
   	typedef XalanObjectCacheDefault<FormatterToText>		FormatterToTextCacheType;
   	typedef XalanObjectCacheDefault<FormatterToSourceTree>	FormatterToSourceTreeCacheType;
   	typedef XalanObjectCacheDefault<NodeSorter>				NodeSorterCacheType;
  +	typedef XalanObjectCache<ResultTreeFragBase, DefaultCacheCreateFunctor<ResultTreeFrag>, DeleteFunctor<ResultTreeFragBase>, ClearCacheResetFunctor<ResultTreeFragBase> >		ResultTreeFragCacheType;
   
   	FormatterToTextCacheType			m_formatterToTextCache;
   
   	FormatterToSourceTreeCacheType		m_formatterToSourceTreeCache;
   
   	NodeSorterCacheType					m_nodeSorterCache;
  +
  +	ResultTreeFragCacheType				m_resultTreeFragCache;
   
   	static XalanNumberFormatFactory		s_defaultXalanNumberFormatFactory;
   
  
  
  
  1.123     +4 -8      xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- XSLTEngineImpl.cpp	2001/10/03 18:18:16	1.122
  +++ XSLTEngineImpl.cpp	2001/10/19 18:42:23	1.123
  @@ -980,9 +980,7 @@
   
   
   void
  -XSLTEngineImpl::outputToResultTree(
  -			StylesheetExecutionContext&		executionContext,
  -			const XObject&					value)
  +XSLTEngineImpl::outputToResultTree(const XObject&	value)
   {
   	const XObject::eObjectType	type = value.getType();
   
  @@ -1065,7 +1063,7 @@
   		break;
   		
   	case XObject::eTypeResultTreeFrag:
  -		outputResultTreeFragment(executionContext, value);
  +		outputResultTreeFragment(value);
   		break;
   
   	case XObject::eTypeNull:
  @@ -2381,11 +2379,9 @@
   
   
   void
  -XSLTEngineImpl::outputResultTreeFragment(
  -			StylesheetExecutionContext&		executionContext,
  -			const XObject&					theTree)
  +XSLTEngineImpl::outputResultTreeFragment(const XObject&		theTree)
   {
  -	const ResultTreeFragBase&	docFrag = theTree.rtree(executionContext);
  +	const ResultTreeFragBase&	docFrag = theTree.rtree();
   
   	const XalanNodeList* const	nl = docFrag.getChildNodes();
   	assert(nl != 0);
  
  
  
  1.77      +2 -6      xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- XSLTEngineImpl.hpp	2001/09/26 21:30:23	1.76
  +++ XSLTEngineImpl.hpp	2001/10/19 18:42:23	1.77
  @@ -249,9 +249,7 @@
   	getSourceTreeFromInput(const XSLTInputSource&	inputSource);
   
   	virtual void
  -	outputToResultTree(
  -			StylesheetExecutionContext&		executionContext,
  -			const XObject&					xobj);
  +	outputToResultTree(const XObject&	xobj);
   
   	virtual void
   	resolveTopLevelParams(StylesheetExecutionContext&	executionContext);
  @@ -607,9 +605,7 @@
   	 * @param theTree result tree fragment
   	 */
   	void
  -	outputResultTreeFragment(
  -			StylesheetExecutionContext&		executionContext,
  -			const XObject& 					theTree);
  +	outputResultTreeFragment(const XObject& 	theTree);
   
   	/**
   	 * Retrieve the root stylesheet.
  
  
  
  1.27      +1 -5      xml-xalan/c/src/XSLT/XSLTProcessor.hpp
  
  Index: XSLTProcessor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessor.hpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XSLTProcessor.hpp	2001/09/26 21:30:23	1.26
  +++ XSLTProcessor.hpp	2001/10/19 18:42:23	1.27
  @@ -214,15 +214,11 @@
   
      /**
   	* Output an object to the result tree by doing the right conversions.
  -	* This is public for access by extensions.
   	*
  -	* @param executionContext	  current execution context
   	* @param obj the XObject to output
   	*/
   	virtual void
  -	outputToResultTree(
  -			StylesheetExecutionContext&		executionContext,
  -			const XObject&					xobj) = 0;
  +	outputToResultTree(const XObject&	xobj) = 0;
   
   	/**
   	 * Retrieve the root stylesheet.
  
  
  
  1.13      +0 -3      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp
  
  Index: XSLTProcessorEnvSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupport.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XSLTProcessorEnvSupport.hpp	2001/09/14 20:49:43	1.12
  +++ XSLTProcessorEnvSupport.hpp	2001/10/19 18:42:23	1.13
  @@ -103,9 +103,6 @@
   	virtual XalanDOMString
   	findURIFromDoc(const XalanDocument*		owner) const = 0;
   
  -	virtual XalanDocument*
  -	getDOMFactory() const = 0;
  -
   	virtual bool
   	elementAvailable(
   			const XalanDOMString&	theNamespace, 
  
  
  
  1.25      +0 -15     xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp
  
  Index: XSLTProcessorEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XSLTProcessorEnvSupportDefault.cpp	2001/09/14 20:49:43	1.24
  +++ XSLTProcessorEnvSupportDefault.cpp	2001/10/19 18:42:23	1.25
  @@ -235,21 +235,6 @@
   
   
   
  -XalanDocument*
  -XSLTProcessorEnvSupportDefault::getDOMFactory() const
  -{
  -	if (m_processor == 0)
  -	{
  -		return m_defaultSupport.getDOMFactory();
  -	}
  -	else
  -	{
  -		return m_processor->getDOMFactory();
  -	}
  -}
  -
  -
  -
   bool
   XSLTProcessorEnvSupportDefault::elementAvailable(
   			const XalanDOMString&	theNamespace,
  
  
  
  1.20      +0 -3      xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp
  
  Index: XSLTProcessorEnvSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.hpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XSLTProcessorEnvSupportDefault.hpp	2001/09/14 20:49:43	1.19
  +++ XSLTProcessorEnvSupportDefault.hpp	2001/10/19 18:42:23	1.20
  @@ -168,9 +168,6 @@
   	virtual XalanDOMString
   	findURIFromDoc(const XalanDocument*		owner) const;
   
  -	virtual XalanDocument*
  -	getDOMFactory() const;
  -
   	virtual bool
   	elementAvailable(
   			const XalanDOMString&	theNamespace, 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org