You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by au...@apache.org on 2001/01/03 16:18:52 UTC

cvs commit: xml-xalan/c/src/XSLT StylesheetHandler.cpp StylesheetHandler.hpp

auriemma    01/01/03 07:18:33

  Modified:    c/src/XSLT StylesheetHandler.cpp StylesheetHandler.hpp
  Log:
  Accumulate character buffer to create contiguous character data where possible.
  
  Revision  Changes    Path
  1.50      +38 -4     xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- StylesheetHandler.cpp	2001/01/02 16:19:03	1.49
  +++ StylesheetHandler.cpp	2001/01/03 15:18:25	1.50
  @@ -137,10 +137,11 @@
   	m_strayElements(),
   	m_whiteSpaceElems(),
   	m_pTemplate(0),
  -	m_lastPopped(0),
  +	m_lastPopped(0),	
   	m_inTemplate(false),
   	m_foundStylesheet(false),
   	m_foundNotImport(false),
  +	m_accumulateText(),
   	m_inLXSLTScript(false),
   	m_LXSLTScriptBody(),
   	m_LXSLTScriptLang(),
  @@ -278,6 +279,7 @@
   #if !defined(XALAN_NO_NAMESPACES)
   		using std::for_each;
   #endif
  +		processAccumulatedText();
   
   		// Clean up the whitespace elements.
   		for_each(m_whiteSpaceElems.begin(),
  @@ -1284,6 +1286,8 @@
   	using std::for_each;
   #endif
   
  +	processAccumulatedText();
  +
   	// Clean up the whitespace elements.
   	for_each(m_whiteSpaceElems.begin(),
   			 m_whiteSpaceElems.end(),
  @@ -1372,7 +1376,7 @@
   	if (m_exceptionPending == true)
   		return;
   
  -	processText(chars, length);
  +	accumulateText(chars, length);
   }
   
   
  @@ -1386,6 +1390,8 @@
   	if (m_exceptionPending == true)
   		return;
   
  +	accumulateText(chars, length);
  +
   	processText(chars, length);
   
   	m_lastPopped = 0;
  @@ -1417,7 +1423,7 @@
   	if (m_exceptionPending == true)
   		return;
   
  -	// No action for the moment.
  +	processAccumulatedText();
   }
   
   
  @@ -1429,7 +1435,7 @@
   	if (m_exceptionPending == true)
   		return;
   
  -	// No action for the moment.
  +	processAccumulatedText();
   }
   
   
  @@ -1558,6 +1564,32 @@
   
   
   
  +void
  +StylesheetHandler::accumulateText(
  +			const XMLCh* const	chars,
  +			const unsigned int	length)
  +{	
  +	if(m_inTemplate)
  +	{
  +		append(m_accumulateText, chars, length);
  +	}
  +}
  +
  +
  +
  +void
  +StylesheetHandler::processAccumulatedText()
  +{
  +	if (isEmpty(m_accumulateText) == false)
  +	{
  +		processText(m_accumulateText.c_str(), length(m_accumulateText));
  +
  +		clear(m_accumulateText);
  +	}	
  +}
  +
  +
  +
   StylesheetHandler::PushPopIncludeState::PushPopIncludeState(StylesheetHandler&	theHandler) :
   	m_handler(theHandler),
   	m_elemStack(theHandler.m_elemStack),
  @@ -1572,6 +1604,7 @@
   	m_namespaces(),
   	m_namespacesHandler()
   {
  +	m_handler.m_accumulateText.clear();
   	m_handler.m_elemStack.clear();
   	m_handler.m_pTemplate = 0;
   	m_handler.m_lastPopped = 0;
  @@ -1600,6 +1633,7 @@
   			 m_handler.m_elemStack.end(),
   			 DeleteFunctor<ElemTemplateElement>());
   
  +	m_handler.m_accumulateText.clear();
   	m_handler.m_elemStack = m_elemStack;
   	m_handler.m_elemStackParentedElements = m_elemStackParentedElements;
   	m_handler.m_pTemplate = m_pTemplate;
  
  
  
  1.21      +16 -2     xml-xalan/c/src/XSLT/StylesheetHandler.hpp
  
  Index: StylesheetHandler.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.hpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- StylesheetHandler.hpp	2000/12/08 22:20:50	1.20
  +++ StylesheetHandler.hpp	2001/01/03 15:18:27	1.21
  @@ -413,6 +413,14 @@
   			const XMLCh* const	chars,
   			const unsigned int	length);
   
  +	void
  +	accumulateText(
  +			const XMLCh* const	chars,
  +			const unsigned int	length);
  +
  +	void
  +	processAccumulatedText();
  +
   	// Data members...
   	XalanDOMString	m_pendingException;
   
  @@ -480,6 +488,12 @@
   	 * to being the first elements.
   	 */
   	bool m_foundNotImport;
  +
  +	/**
  +	 * Accumulate character buffer to create contiguous character data
  +	 * where possible.
  +	 */
  +	XalanDOMString	m_accumulateText;
   	
   	// BEGIN SANJIVA CODE
   	bool m_inLXSLTScript;
  @@ -518,9 +532,9 @@
   
   		ElemTemplate* const					m_pTemplate;
   
  -		ElemTemplateElement* const			m_lastPopped;
  +		ElemTemplateElement* const			m_lastPopped;		
   
  -		const bool							m_inTemplate;
  +		const bool							m_inTemplate;		
   
   		const bool							m_foundStylesheet;