dbertoni    01/07/11 21:44:21

  Modified:    c/src/XSLT StylesheetExecutionContextDefault.cpp
                        StylesheetRoot.cpp VariablesStack.cpp
                        VariablesStack.hpp
  Log:
  Fixed problem with pushing top-level params and stack state.
  
  Revision  Changes    Path
  1.69      +25 -29    
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- StylesheetExecutionContextDefault.cpp     2001/06/25 20:17:19     1.68
  +++ StylesheetExecutionContextDefault.cpp     2001/07/12 04:44:16     1.69
  @@ -663,8 +663,6 @@
   void
   StylesheetExecutionContextDefault::resolveTopLevelParams()
   {
  -     pushContextMarker();
  -
        assert(m_xsltProcessor != 0);
   
        m_xsltProcessor->resolveTopLevelParams(*this);
  @@ -680,29 +678,9 @@
        assert(m_xsltProcessor != 0);
   
        m_xsltProcessor->clearTopLevelParams();
  -}
  -
   
  -
  -class PopPushContextMarker
  -{
  -public:
  -
  -     PopPushContextMarker(StylesheetExecutionContext&        
theExecutionContext) :
  -             m_executionContext(theExecutionContext)
  -     {
  -             m_executionContext.popContextMarker();
  -     }
  -
  -     ~PopPushContextMarker()
  -     {
  -             m_executionContext.pushContextMarker();
  -     }
  -
  -private:
  -
  -     StylesheetExecutionContext&             m_executionContext;
  -};
  +     m_variablesStack.unmarkGlobalStackFrame();
  +}
   
   
   
  @@ -817,10 +795,6 @@
   
        m_xsltProcessor->endDocument();
   
  -     // This matches the pushContextMarker in
  -     // resolveTopLevelParams().
  -     popContextMarker();
  -
        cleanUpTransients();
   
        setFormatterListener(0);
  @@ -2004,6 +1978,28 @@
   
   
   
  +class PopAndPushContextMarker
  +{
  +public:
  +
  +     PopAndPushContextMarker(StylesheetExecutionContext&     
theExecutionContext) :
  +             m_executionContext(theExecutionContext)
  +     {
  +             m_executionContext.popContextMarker();
  +     }
  +
  +     ~PopAndPushContextMarker()
  +     {
  +             m_executionContext.pushContextMarker();
  +     }
  +
  +private:
  +
  +     StylesheetExecutionContext&             m_executionContext;
  +};
  +
  +
  +
   void
   StylesheetExecutionContextDefault::getParams(
                        const ElemTemplateElement&      xslCallTemplateElement,
  @@ -2020,7 +2016,7 @@
                // This object will take care of popping, then
                // pushing the context marker at the top of the
                // stack, even if an exception is thrown.
  -             PopPushContextMarker    thePopPush(*this);
  +             PopAndPushContextMarker         thePopPush(*this);
   
                while(0 != child)
                {
  
  
  
  1.49      +9 -0      xml-xalan/c/src/XSLT/StylesheetRoot.cpp
  
  Index: StylesheetRoot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.cpp,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- StylesheetRoot.cpp        2001/07/08 18:48:40     1.48
  +++ StylesheetRoot.cpp        2001/07/12 04:44:16     1.49
  @@ -228,6 +228,15 @@
                executionContext.pushTime(&sourceTree);
        }
   
  +     typedef StylesheetExecutionContext::PushAndPopContextMarker     
PushAndPopContextMarker;
  +     typedef StylesheetExecutionContext::PushAndPopElementFrame      
PushAndPopElementFrame;
  +
  +     PushAndPopContextMarker         
thePushAndPopContextMarker(executionContext);
  +
  +     PushAndPopElementFrame          thePushAndPopElementFrame(
  +                             executionContext,
  +                             0);
  +
        executionContext.resolveTopLevelParams();
   
   #if defined(XALAN_VQ_SPECIAL_TRACE)
  
  
  
  1.18      +13 -0     xml-xalan/c/src/XSLT/VariablesStack.cpp
  
  Index: VariablesStack.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/VariablesStack.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- VariablesStack.cpp        2001/07/08 18:48:40     1.17
  +++ VariablesStack.cpp        2001/07/12 04:44:17     1.18
  @@ -99,6 +99,7 @@
        m_stack.clear();
   
        m_globalStackFrameMarked = false;
  +     m_globalStackFrameIndex = -1;
   }
   
   
  @@ -353,6 +354,18 @@
        m_globalStackFrameMarked = true;
   
        pushContextMarker();
  +}
  +
  +
  +
  +void
  +VariablesStack::unmarkGlobalStackFrame()
  +{
  +     popContextMarker();
  +
  +     m_globalStackFrameIndex = -1;
  +
  +     m_globalStackFrameMarked = false;
   }
   
   
  
  
  
  1.13      +6 -0      xml-xalan/c/src/XSLT/VariablesStack.hpp
  
  Index: VariablesStack.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/VariablesStack.hpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- VariablesStack.hpp        2001/06/25 15:20:09     1.12
  +++ VariablesStack.hpp        2001/07/12 04:44:18     1.13
  @@ -280,6 +280,12 @@
        markGlobalStackFrame();
   
        /**
  +      * Clear the marking of the global stack frame.
  +      */
  +     void
  +     unmarkGlobalStackFrame();
  +
  +     /**
         * Set the top of the stack frame from where a search for a variable or
         * param should take place.  Calling with no parameter will cause the
         * index to be set to the size of the stack.
  
  
  

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

Reply via email to