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 2003/10/26 02:50:30 UTC

cvs commit: xml-xalan/c/src/xalanc/XSLT StylesheetExecutionContextDefault.cpp StylesheetExecutionContextDefault.hpp XResultTreeFrag.cpp XResultTreeFrag.hpp XResultTreeFragAllocator.cpp XResultTreeFragAllocator.hpp XSLTEngineImpl.cpp XSLTEngineImpl.hpp XSLTProcessor.hpp ResultTreeFrag.cpp ResultTreeFrag.hpp ResultTreeFragAllocator.cpp ResultTreeFragAllocator.hpp ResultTreeFragBaseNodeRefListBaseProxy.cpp ResultTreeFragBaseNodeRefListBaseProxy.hpp

dbertoni    2003/10/25 17:50:30

  Modified:    c/src/xalanc/XSLT StylesheetExecutionContextDefault.cpp
                        StylesheetExecutionContextDefault.hpp
                        XResultTreeFrag.cpp XResultTreeFrag.hpp
                        XResultTreeFragAllocator.cpp
                        XResultTreeFragAllocator.hpp XSLTEngineImpl.cpp
                        XSLTEngineImpl.hpp XSLTProcessor.hpp
  Removed:     c/src/xalanc/XSLT ResultTreeFrag.cpp ResultTreeFrag.hpp
                        ResultTreeFragAllocator.cpp
                        ResultTreeFragAllocator.hpp
                        ResultTreeFragBaseNodeRefListBaseProxy.cpp
                        ResultTreeFragBaseNodeRefListBaseProxy.hpp
  Log:
  Refactored result tree fragments to use XalanDocumentFragment instead of ResultTreeFragBase.  This is because the node-set() extension exposes some awkward problems with the implementation.  This also simplifies things, so although it changes our XObject interface, in the end, it's much cleaner.  Fixes Bugzilla 23778.
  
  Revision  Changes    Path
  1.9       +7 -24     xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StylesheetExecutionContextDefault.cpp	11 Aug 2003 20:31:29 -0000	1.8
  +++ StylesheetExecutionContextDefault.cpp	26 Oct 2003 00:50:30 -0000	1.9
  @@ -81,7 +81,6 @@
   
   
   
  -#include <xalanc/XPath/ResultTreeFragBase.hpp>
   #include <xalanc/XPath/XObjectFactory.hpp>
   #include <xalanc/XPath/XPath.hpp>
   #include <xalanc/XPath/XPathEnvSupport.hpp>
  @@ -174,7 +173,6 @@
   	m_nodeSorterCache(),
   	m_indentAmount(-1),
   	m_xresultTreeFragAllocator(eXResultTreeFragAllocatorBlockSize),
  -	m_resultTreeFragAllocator(eResultTreeFragAllocatorBlockSize),
   	m_documentFragmentAllocator(eDocumentFragmentAllocatorBlockSize),
   	m_documentAllocator(eDocumentAllocatorBlockSize),
   	m_usePerInstanceDocumentFactory(false),
  @@ -217,7 +215,6 @@
   	m_nodeSorterCache(),
   	m_indentAmount(-1),
   	m_xresultTreeFragAllocator(eXResultTreeFragAllocatorBlockSize),
  -	m_resultTreeFragAllocator(eResultTreeFragAllocatorBlockSize),
   	m_documentFragmentAllocator(eDocumentFragmentAllocatorBlockSize),
   	m_documentAllocator(eDocumentAllocatorBlockSize),
   	m_usePerInstanceDocumentFactory(false),
  @@ -1028,10 +1025,6 @@
   		m_documentFragmentAllocator.create(*theDocument);
   	assert(theDocumentFragment != 0);
   
  -	ResultTreeFragBase* const	theResultTreeFrag =
  -		m_resultTreeFragAllocator.create(theDocumentFragment);
  -	assert(theResultTreeFrag != 0);
  -
   	GuardCachedObject<FormatterToSourceTreeCacheType>	theGuard(m_formatterToSourceTreeCache);
   
   	FormatterToSourceTree* const	theFormatter = theGuard.get();
  @@ -1054,7 +1047,7 @@
   	theFormatter->endDocument();
   
   	XResultTreeFrag* const	theXResultTreeFrag =
  -		m_xresultTreeFragAllocator.create(*theResultTreeFrag);
  +		m_xresultTreeFragAllocator.create(*theDocumentFragment);
   
   	theXResultTreeFrag->setExecutionContext(this);
   
  @@ -1188,24 +1181,11 @@
   	}
   	else
   	{
  -		ResultTreeFragBase* const	theResultTreeFragBase =
  +		XalanDocumentFragment* const	theDocumentFragment =
   			theXResultTreeFrag->release();
   
   		m_xresultTreeFragAllocator.destroy(theXResultTreeFrag);
   
  -		ResultTreeFrag* const	theResultTreeFrag =
  -#if defined(XALAN_OLD_STYLE_CASTS)
  -			(ResultTreeFrag*)theResultTreeFragBase;
  -#else
  -			static_cast<ResultTreeFrag*>(theResultTreeFragBase);
  -#endif
  -
  -		XalanSourceTreeDocumentFragment* const	theDocumentFragment =
  -			theResultTreeFrag->getDocumentFragment();
  -		assert(theDocumentFragment != 0);
  -
  -		m_resultTreeFragAllocator.destroy(theResultTreeFrag);
  -
   		if (m_usePerInstanceDocumentFactory == true)
   		{
   #if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  @@ -1219,7 +1199,11 @@
   #endif
   		}
   
  -		m_documentFragmentAllocator.destroy(theDocumentFragment);
  +#if defined(XALAN_OLD_STYLE_CASTS)
  +		m_documentFragmentAllocator.destroy((XalanSourceTreeDocumentFragment*)theDocumentFragment);
  +#else
  +		m_documentFragmentAllocator.destroy(static_cast<XalanSourceTreeDocumentFragment*>(theDocumentFragment));
  +#endif
   
           return true;
   	}
  @@ -1693,7 +1677,6 @@
   	m_nodeSorterCache.reset();
   	m_documentAllocator.reset();
   	m_documentFragmentAllocator.reset();
  -	m_resultTreeFragAllocator.reset();
   	m_xresultTreeFragAllocator.reset();
   
   	// Just in case endDocument() was not called,
  
  
  
  1.8       +0 -5      xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp
  
  Index: StylesheetExecutionContextDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StylesheetExecutionContextDefault.hpp	11 Aug 2003 20:31:29 -0000	1.7
  +++ StylesheetExecutionContextDefault.hpp	26 Oct 2003 00:50:30 -0000	1.8
  @@ -96,8 +96,6 @@
   
   #include <xalanc/XSLT/CountersTable.hpp>
   #include <xalanc/XSLT/NodeSorter.hpp>
  -#include <xalanc/XSLT/ResultTreeFrag.hpp>
  -#include <xalanc/XSLT/ResultTreeFragAllocator.hpp>
   #include <xalanc/XSLT/Stylesheet.hpp>
   #include <xalanc/XSLT/VariablesStack.hpp>
   #include <xalanc/XSLT/XResultTreeFragAllocator.hpp>
  @@ -1071,7 +1069,6 @@
   	enum { eXPathCacheMax = 50,
   		   eDefaultParamsVectorSize = 10,
   		   eXResultTreeFragAllocatorBlockSize = 10,
  -		   eResultTreeFragAllocatorBlockSize = 10,
   		   eDocumentAllocatorBlockSize = 10,
   		   eDocumentFragmentAllocatorBlockSize = 10,
   		   eDefaultAttributeAllocatorBlockSize = 10,
  @@ -1141,8 +1138,6 @@
   	int									m_indentAmount;
   
   	XResultTreeFragAllocator			m_xresultTreeFragAllocator;
  -
  -	ResultTreeFragAllocator				m_resultTreeFragAllocator;
   
   	XalanSourceTreeDocumentFragmentAllocator	m_documentFragmentAllocator;
   
  
  
  
  1.3       +7 -7      xml-xalan/c/src/xalanc/XSLT/XResultTreeFrag.cpp
  
  Index: XResultTreeFrag.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XResultTreeFrag.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XResultTreeFrag.cpp	19 Sep 2003 21:05:30 -0000	1.2
  +++ XResultTreeFrag.cpp	26 Oct 2003 00:50:30 -0000	1.3
  @@ -59,6 +59,7 @@
   
   
   
  +#include <xalanc/XalanDOM/XalanDocumentFragment.hpp>
   #include <xalanc/XalanDOM/XalanNodeList.hpp>
   #include <xalanc/XalanDOM/XalanText.hpp>
   
  @@ -75,7 +76,6 @@
   
   #include <xalanc/XPath/FormatterStringLengthCounter.hpp>
   #include <xalanc/XPath/NodeRefListBase.hpp>
  -#include <xalanc/XPath/ResultTreeFragBase.hpp>
   #include <xalanc/XPath/XObjectTypeCallback.hpp>
   
   
  @@ -89,7 +89,7 @@
   
   
   inline const XalanDOMString*
  -getSingleTextChildValue(const ResultTreeFragBase&	theRTreeFrag)
  +getSingleTextChildValue(const XalanDocumentFragment&	theRTreeFrag)
   {
   	const XalanNode* const	theFirstChild = theRTreeFrag.getFirstChild();
   
  @@ -107,7 +107,7 @@
   
   
   
  -XResultTreeFrag::XResultTreeFrag(ResultTreeFragBase&	value) :
  +XResultTreeFrag::XResultTreeFrag(XalanDocumentFragment&		value) :
   	XObject(eTypeResultTreeFrag),
   	m_value(&value),
   	m_singleTextChildValue(getSingleTextChildValue(value)),
  @@ -287,7 +287,7 @@
   
   
   
  -const ResultTreeFragBase&
  +const XalanDocumentFragment&
   XResultTreeFrag::rtree() const
   {
   	assert(m_value != 0);
  @@ -323,7 +323,7 @@
   
   
   
  -ResultTreeFragBase*
  +XalanDocumentFragment*
   XResultTreeFrag::release()
   {
   	m_singleTextChildValue = 0;
  @@ -332,7 +332,7 @@
   
   	m_cachedNumberValue = 0.0;
   
  -	ResultTreeFragBase* const	temp = m_value;
  +	XalanDocumentFragment* const	temp = m_value;
   
   	m_value = 0;
   
  @@ -342,7 +342,7 @@
   
   
   void
  -XResultTreeFrag::set(ResultTreeFragBase&	theValue)
  +XResultTreeFrag::set(XalanDocumentFragment&		theValue)
   {
   	release();
   
  
  
  
  1.3       +5 -5      xml-xalan/c/src/xalanc/XSLT/XResultTreeFrag.hpp
  
  Index: XResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XResultTreeFrag.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XResultTreeFrag.hpp	19 Sep 2003 21:05:30 -0000	1.2
  +++ XResultTreeFrag.hpp	26 Oct 2003 00:50:30 -0000	1.3
  @@ -108,7 +108,7 @@
   	 * 
   	 * @param val source result tree fragment.
   	 */
  -	XResultTreeFrag(ResultTreeFragBase&		value);
  +	XResultTreeFrag(XalanDocumentFragment&		value);
   
   	/**
   	 * Construct an XResultTreeFrag object from another
  @@ -162,7 +162,7 @@
   	virtual double
   	stringLength() const;
   
  -	virtual const ResultTreeFragBase&
  +	virtual const XalanDocumentFragment&
   	rtree() const;
   
   	virtual const NodeRefListBase&
  @@ -177,7 +177,7 @@
   	/**
   	 * Release the ResultTreeFrag held by the instance.
   	 */
  -	ResultTreeFragBase*
  +	XalanDocumentFragment*
   	release();
   
   	/**
  @@ -186,7 +186,7 @@
   	 * @param theValue The new value.
   	 */
   	void
  -	set(ResultTreeFragBase&		theValue);
  +	set(XalanDocumentFragment&	theValue);
   
   protected:
   
  @@ -196,7 +196,7 @@
   private:
   
   	// Data members...
  -	ResultTreeFragBase*				m_value;	
  +	XalanDocumentFragment*			m_value;	
   
   	const XalanDOMString*			m_singleTextChildValue;
   
  
  
  
  1.3       +1 -1      xml-xalan/c/src/xalanc/XSLT/XResultTreeFragAllocator.cpp
  
  Index: XResultTreeFragAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XResultTreeFragAllocator.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XResultTreeFragAllocator.cpp	19 Sep 2003 21:05:30 -0000	1.2
  +++ XResultTreeFragAllocator.cpp	26 Oct 2003 00:50:30 -0000	1.3
  @@ -79,7 +79,7 @@
   
   
   XResultTreeFragAllocator::data_type*
  -XResultTreeFragAllocator::create(ResultTreeFragBase&	theValue)
  +XResultTreeFragAllocator::create(XalanDocumentFragment&		theValue)
   {
   	data_type* const	theBlock = m_allocator.allocateBlock();
   	assert(theBlock != 0);
  
  
  
  1.3       +1 -1      xml-xalan/c/src/xalanc/XSLT/XResultTreeFragAllocator.hpp
  
  Index: XResultTreeFragAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XResultTreeFragAllocator.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XResultTreeFragAllocator.hpp	19 Sep 2003 21:05:30 -0000	1.2
  +++ XResultTreeFragAllocator.hpp	26 Oct 2003 00:50:30 -0000	1.3
  @@ -103,7 +103,7 @@
   	 * @return pointer to a node
   	 */
   	data_type*
  -	create(ResultTreeFragBase&	theValue);
  +	create(XalanDocumentFragment&	theValue);
   
   	/**
   	 * Create an XResultTreeFrag object.
  
  
  
  1.9       +2 -6      xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSLTEngineImpl.cpp	19 Sep 2003 21:05:30 -0000	1.8
  +++ XSLTEngineImpl.cpp	26 Oct 2003 00:50:30 -0000	1.9
  @@ -73,6 +73,7 @@
   
   
   #include <xalanc/XalanDOM/XalanDOMException.hpp>
  +#include <xalanc/XalanDOM/XalanDocumentFragment.hpp>
   #include <xalanc/XalanDOM/XalanNode.hpp>
   #include <xalanc/XalanDOM/XalanAttr.hpp>
   #include <xalanc/XalanDOM/XalanComment.hpp>
  @@ -105,7 +106,6 @@
   
   #include <xalanc/XPath/ElementPrefixResolverProxy.hpp>
   #include <xalanc/XPath/XalanQNameByReference.hpp>
  -#include <xalanc/XPath/ResultTreeFragBase.hpp>
   #include <xalanc/XPath/XObject.hpp>
   #include <xalanc/XPath/XObjectFactory.hpp>
   #include <xalanc/XPath/XPathEnvSupport.hpp>
  @@ -2187,11 +2187,7 @@
   
   					posNodeType = pos->getNodeType();
   
  -					if (posNodeType == XalanNode::DOCUMENT_FRAGMENT_NODE)
  -					{
  -						break;
  -					}
  -					else if (&node == pos)
  +					if (&node == pos)
   					{
   						if(XalanNode::ELEMENT_NODE == posNodeType)
   						{
  
  
  
  1.5       +0 -1      xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSLTEngineImpl.hpp	19 Sep 2003 21:05:30 -0000	1.4
  +++ XSLTEngineImpl.hpp	26 Oct 2003 00:50:30 -0000	1.5
  @@ -136,7 +136,6 @@
   class DOMSupport;
   class GenerateEvent;
   class PrintWriter;
  -class ResultTreeFragBase;
   class StylesheetConstructionContext;
   class StylesheetExecutionContext;
   class StylesheetRoot;
  
  
  
  1.3       +0 -1      xml-xalan/c/src/xalanc/XSLT/XSLTProcessor.hpp
  
  Index: XSLTProcessor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTProcessor.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XSLTProcessor.hpp	19 Sep 2003 21:05:30 -0000	1.2
  +++ XSLTProcessor.hpp	26 Oct 2003 00:50:30 -0000	1.3
  @@ -90,7 +90,6 @@
   class NodeRefListBase;
   class PrefixResolver;
   class PrintWriter;
  -class ResultTreeFragBase;
   class SelectionEvent;
   class StylesheetConstructionContext;
   class StylesheetExecutionContext;
  
  
  

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