dbertoni    2002/07/26 11:36:29

  Modified:    c/src/XSLT StylesheetHandler.cpp
  Log:
  Don't add template to stylesheet until endElement() to prevent a problem with 
double-deletion if there's an error.
  
  Revision  Changes    Path
  1.83      +6 -1      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.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- StylesheetHandler.cpp     24 Jul 2002 23:19:43 -0000      1.82
  +++ StylesheetHandler.cpp     26 Jul 2002 18:36:29 -0000      1.83
  @@ -819,6 +819,8 @@
                                                           
c_wstr(Constants::ATTRTYPE_CDATA),
                                                           
c_wstr(Constants::ATTRVAL_SIMPLE));
   
  +     assert(m_pTemplate == 0);
  +
        m_pTemplate = new ElemTemplate(m_constructionContext,
                                                                   m_stylesheet,
                                                                   
templateAttrs,
  @@ -917,6 +919,8 @@
        switch(xslToken)
        {
        case Constants::ELEMNAME_TEMPLATE:
  +             assert(m_pTemplate == 0);
  +
                m_pTemplate = new ElemTemplate(
                                m_constructionContext,
                                m_stylesheet,
  @@ -927,7 +931,6 @@
                m_elemStack.push_back(m_pTemplate);
                m_elemStackParentedElements.insert(m_pTemplate);
                m_inTemplate = true;
  -             m_stylesheet.addTemplate(m_pTemplate, m_constructionContext);
                break;
   
        case Constants::ELEMNAME_EXTENSION:
  @@ -1611,6 +1614,8 @@
        if(Constants::ELEMNAME_TEMPLATE == tok)
        {
                m_inTemplate = false;
  +             m_stylesheet.addTemplate(m_pTemplate, m_constructionContext);
  +             m_pTemplate = 0;
        }
        else if((Constants::ELEMNAME_PARAMVARIABLE == tok) ||
                Constants::ELEMNAME_VARIABLE == tok)
  
  
  

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

Reply via email to