xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mh...@apache.org
Subject cvs commit: xml-xalan/c/src/xalanc/XSLT ElemForEach.cpp
Date Fri, 10 Dec 2004 04:01:51 GMT
mhoyt       2004/12/09 20:01:51

  Modified:    c/src/xalanc/XSLT ElemForEach.cpp
  Log:
  Execution was corrupted if <xsl:for-each> contained a single <xsl:call-template>
and the invoked template was not the last template in the stylesheet.
  
  Revision  Changes    Path
  1.15      +16 -11    xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp
  
  Index: ElemForEach.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ElemForEach.cpp	8 Nov 2004 18:18:56 -0000	1.14
  +++ ElemForEach.cpp	10 Dec 2004 04:01:51 -0000	1.15
  @@ -220,12 +220,15 @@
   				   StylesheetExecutionContext& executionContext,
   				   const ElemTemplateElement* currentElem) const
   {
  -	ElemTemplateElement* nextElement = currentElem->getNextSiblingElem();
  -
  -	if (nextElement != 0)
  -	{
  -		return nextElement;
  -	}
  +    if (hasDirectTemplate() != true)
  +    {
  +        ElemTemplateElement* nextElement = currentElem->getNextSiblingElem();
  +
  +        if (nextElement != 0)
  +        {
  +	        return nextElement;
  +        }
  +    }
   
   	executionContext.popCurrentNode();
   
  @@ -303,14 +306,16 @@
   	}
   
   	if (m_sortElemsCount > 0) 
  -		//&& nodesToTransform->getLength() > 1)
   	{
   		MutableNodeRefList& sortedNodeList = executionContext.createAndPushMutableNodeRefList();
   
  -		nodesToTransform = sortChildren(
  -				executionContext,
  -				*nodesToTransform,
  -				sortedNodeList);
  +        if (nodesToTransform->getLength() > 1)
  +        {
  +		    nodesToTransform = sortChildren(
  +				    executionContext,
  +				    *nodesToTransform,
  +				    sortedNodeList);
  +        }
   	}
   
   	return nodesToTransform;
  
  
  

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


Mime
View raw message