dbertoni    2004/10/12 12:19:17

  Modified:    c/src/xalanc/XSLT ElemVariable.cpp ElemWithParam.cpp
  Log:
  Fixed bug where endExecuteChildren() was not called, resulting in an 
InvalidStackContextException exception.  Cleaned up code.
  
  Revision  Changes    Path
  1.11      +20 -38    xml-xalan/c/src/xalanc/XSLT/ElemVariable.cpp
  
  Index: ElemVariable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemVariable.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemVariable.cpp  31 Jul 2004 05:08:49 -0000      1.10
  +++ ElemVariable.cpp  12 Oct 2004 19:19:16 -0000      1.11
  @@ -221,13 +221,13 @@
   
   #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
   const ElemTemplateElement*
  -ElemVariable::startElement(StylesheetExecutionContext& executionContext) 
const
  +ElemVariable::startElement(StylesheetExecutionContext&  executionContext) 
const
   {
        assert(m_qname != 0);
   
        ParentType::startElement(executionContext);
   
  -     XObjectPtr theValue;
  +     XObjectPtr  theValue;
   
        if(m_selectPattern == 0)
        {
  @@ -238,6 +238,7 @@
                else
                {
                        
executionContext.beginCreateXResultTreeFrag(executionContext.getCurrentNode());
  +
                        return beginExecuteChildren(executionContext);
                }
        }
  @@ -259,50 +260,30 @@
   
        }
   
  -     if (theValue.null() == false)
  -     {
  -             executionContext.pushVariable(
  -                             *m_qname,
  -                             theValue,
  -                             getParentNodeElem());
  -     }
  -     else
  -     {
  -             executionContext.pushVariable(
  -                             *m_qname,
  -                             this,
  -                             getParentNodeElem());
  -     }
  +    assert(theValue.null() == false);
  +
  +    executionContext.pushVariable(
  +                     *m_qname,
  +                     theValue,
  +                     getParentNodeElem());
   
        return 0;
   }
   
   
  +
   void
  -ElemVariable::endElement(StylesheetExecutionContext& executionContext) const
  +ElemVariable::endElement(StylesheetExecutionContext&    executionContext) 
const
   {
  -     XObjectPtr theValue;
  -
        if (0 == m_selectPattern && 0 != getFirstChildElem())
        {
  -             theValue = executionContext.endCreateXResultTreeFrag();
  -             if (theValue.null() == false)
  -             {
  -                     executionContext.pushVariable(
  -                                     *m_qname,
  -                                     theValue,
  -                                     getParentNodeElem());
  -             }
  -             else
  -             {
  -                     executionContext.pushVariable(
  -                                     *m_qname,
  -                                     this,
  -                                     getParentNodeElem());
  -             }
  -     }
  +        endExecuteChildren(executionContext);
   
  -     
  +             executionContext.pushVariable(
  +                             *m_qname,
  +                             executionContext.endCreateXResultTreeFrag(),
  +                             getParentNodeElem());
  +     }
   }
   
   
  @@ -357,10 +338,11 @@
                }
                else
                {
  -                     
   #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
                        executionContext.beginCreateXResultTreeFrag(sourceNode);
  -                     this->executeChildren(executionContext);
  +
  +                     executeChildren(executionContext);
  +
                        return executionContext.endCreateXResultTreeFrag();
   #else
                        return executionContext.createXResultTreeFrag(*this, 
sourceNode);
  
  
  
  1.9       +16 -30    xml-xalan/c/src/xalanc/XSLT/ElemWithParam.cpp
  
  Index: ElemWithParam.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemWithParam.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ElemWithParam.cpp 31 Jul 2004 05:08:50 -0000      1.8
  +++ ElemWithParam.cpp 12 Oct 2004 19:19:16 -0000      1.9
  @@ -134,13 +134,13 @@
   #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
   
   const ElemTemplateElement* 
  -ElemWithParam::startElement(StylesheetExecutionContext& executionContext) 
const
  +ElemWithParam::startElement(StylesheetExecutionContext&     
executionContext) const
   {
        assert(m_qname != 0);
   
        ElemTemplateElement::startElement(executionContext);
   
  -     XObjectPtr theValue;
  +     XObjectPtr  theValue;
   
        if(m_selectPattern == 0)
        {
  @@ -151,7 +151,8 @@
                else
                {
                        
executionContext.beginCreateXResultTreeFrag(executionContext.getCurrentNode());
  -                     return beginExecuteChildren(executionContext);
  +
  +            return beginExecuteChildren(executionContext);
                }
        }
        else
  @@ -172,46 +173,31 @@
   
        }
   
  -     if (theValue.null() == false)
  -     {
  -             executionContext.pushParam(
  -                             *m_qname,
  -                             theValue);
  -     }
  -     else
  -     {
  -             executionContext.pushParam(
  -                             *m_qname,
  -                             theValue);
  -     }
  +    assert(theValue.null() == false);
  +
  +    executionContext.pushParam(
  +                     *m_qname,
  +                     theValue);
   
        return 0;
   }
   
   
  +
   void
  -ElemWithParam::endElement(StylesheetExecutionContext& executionContext) const
  +ElemWithParam::endElement(StylesheetExecutionContext&   executionContext) 
const
   {
  -     XObjectPtr theValue;
  -
        if (0 == m_selectPattern && 0 != getFirstChildElem())
        {
  -             theValue = executionContext.endCreateXResultTreeFrag();
  -             if (theValue.null() == false)
  -             {
  -                     executionContext.pushParam(
  -                                     *m_qname,
  -                                     theValue);
  -             }
  -             else
  -             {
  -                     executionContext.pushParam(
  +        endExecuteChildren(executionContext);
  +
  +        executionContext.pushParam(
                                        *m_qname,
  -                                     theValue);
  -             }
  +                                     
executionContext.endCreateXResultTreeFrag());
        }
   }
   #endif
  +
   
   
   XALAN_CPP_NAMESPACE_END
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to