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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to