dbertoni    00/06/04 18:12:25

  Modified:    c/src/XSLT ElemAttributeSet.cpp
                        StylesheetExecutionContextDefault.cpp
  Log:
  Fix for bug with xsl:attribute-set (atrs07).
  
  Revision  Changes    Path
  1.4       +4 -12     xml-xalan/c/src/XSLT/ElemAttributeSet.cpp
  
  Index: ElemAttributeSet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttributeSet.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ElemAttributeSet.cpp      2000/04/11 15:09:23     1.3
  +++ ElemAttributeSet.cpp      2000/06/05 01:12:24     1.4
  @@ -94,6 +94,7 @@
                if(equals(aname,Constants::ATTRNAME_NAME))
                {
                        m_QName = QName(atts.getValue(i), 
stylesheetTree.getNamespaces());
  +
                        stylesheetTree.addAttributeSet(m_QName, this);
                }
                else if(!(processUseAttributeSets(constructionContext, aname, 
atts, i) ||
  @@ -123,19 +124,12 @@
                        XalanNode*                                              
sourceTree,
                        XalanNode*                                              
sourceNode,
                        const QName&                                    mode) 
const
  -{    
  -     if(executionContext.findOnElementRecursionStack(this) != false)
  -     {
  -             XalanDOMString msg("xsl:attribute-set '" 
  -                                       + m_QName.getLocalPart() + 
  -                                       "' used itself, which will cause an 
infinite loop.");
  -
  -             throw SAXException(toCharArray(msg));
  -     }
  -
  +{
        // This will push and pop the stack automatically...
        StylesheetExecutionContext::ElementRecursionStackPusher         
thePusher(executionContext, this);
   
  +     ElemUse::execute(executionContext, sourceTree, sourceNode, mode);
  +
        const ElemTemplateElement*      attr = getFirstChildElem();
   
        while(0 != attr)
  @@ -144,8 +138,6 @@
   
                attr = attr->getNextSiblingElem();
        }
  -
  -     ElemUse::execute(executionContext, sourceTree, sourceNode, mode);
   }
   
   
  
  
  
  1.17      +10 -1     
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StylesheetExecutionContextDefault.cpp     2000/06/01 16:28:37     1.16
  +++ StylesheetExecutionContextDefault.cpp     2000/06/05 01:12:24     1.17
  @@ -94,8 +94,10 @@
   
   
   
  +#include "ElemTemplateElement.hpp"
   #include "StylesheetRoot.hpp"
   #include "XSLTEngineImpl.hpp"
  +#include "XSLTProcessorException.hpp"
   
   
   
  @@ -773,7 +775,14 @@
   void
   StylesheetExecutionContextDefault::pushOnElementRecursionStack(const 
ElemTemplateElement*    theElement)
   {
  -     assert(findOnElementRecursionStack(theElement) == false);
  +     if (findOnElementRecursionStack(theElement) == true)
  +     {
  +             XalanDOMString  theMessage(XALAN_STATIC_UCODE_STRING("Infinite 
recursion detected for element: "));
  +
  +             theMessage += theElement->getNodeName();
  +
  +             throw XSLTProcessorException(theMessage);
  +     }
   
        m_elementRecursionStack.push_back(theElement);
   }
  
  
  

Reply via email to