dbertoni    2004/03/26 18:11:03

  Modified:    c/src/xalanc/XSLT ElemApplyImport.cpp ElemCallTemplate.cpp
                        ElemTemplate.cpp ElemTemplate.hpp
                        ElemTemplateElement.cpp
                        StylesheetExecutionContextDefault.cpp
  Log:
  Fix for bugzilla 27841.
  
  Revision  Changes    Path
  1.6       +1 -1      xml-xalan/c/src/xalanc/XSLT/ElemApplyImport.cpp
  
  Index: ElemApplyImport.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemApplyImport.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElemApplyImport.cpp       26 Feb 2004 22:58:57 -0000      1.5
  +++ ElemApplyImport.cpp       27 Mar 2004 02:11:03 -0000      1.6
  @@ -105,7 +105,7 @@
                        executionContext,
                        *this,
                        0,
  -                     sourceNode);   
  +                     sourceNode);
   }
   
   
  
  
  
  1.8       +1 -1      xml-xalan/c/src/xalanc/XSLT/ElemCallTemplate.cpp
  
  Index: ElemCallTemplate.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemCallTemplate.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ElemCallTemplate.cpp      26 Feb 2004 22:58:57 -0000      1.7
  +++ ElemCallTemplate.cpp      27 Mar 2004 02:11:03 -0000      1.8
  @@ -129,7 +129,7 @@
                                executionContext,
                                *this);
   
  -     m_template->execute(executionContext);
  +     m_template->executeAsNamed(executionContext);
   }
   
   
  
  
  
  1.8       +3 -3      xml-xalan/c/src/xalanc/XSLT/ElemTemplate.cpp
  
  Index: ElemTemplate.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemTemplate.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ElemTemplate.cpp  26 Feb 2004 22:58:57 -0000      1.7
  +++ ElemTemplate.cpp  27 Mar 2004 02:11:03 -0000      1.8
  @@ -181,7 +181,7 @@
   void
   ElemTemplate::execute(StylesheetExecutionContext&    executionContext) const
   {
  -     ElemTemplateElement::execute(executionContext);
  +     ParentType::execute(executionContext);
   
        executeChildren(executionContext);
   }
  @@ -201,7 +201,7 @@
   {
        StylesheetExecutionContext::PushAndPopCurrentTemplate   
thePushAndPop(executionContext, this);
   
  -     ElemTemplateElement::executeChildren(executionContext);
  +     ParentType::executeChildren(executionContext);
   }
   
   
  @@ -211,7 +211,7 @@
                StylesheetExecutionContext&             executionContext,
                XalanNode*                                              
sourceNode) const
   {
  -     ElemTemplateElement::executeChildren(executionContext, sourceNode);
  +     ParentType::executeChildren(executionContext, sourceNode);
   }
   
   
  
  
  
  1.6       +8 -0      xml-xalan/c/src/xalanc/XSLT/ElemTemplate.hpp
  
  Index: ElemTemplate.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemTemplate.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElemTemplate.hpp  26 Feb 2004 22:58:57 -0000      1.5
  +++ ElemTemplate.hpp  27 Mar 2004 02:11:03 -0000      1.6
  @@ -42,6 +42,8 @@
   {
   public:
   
  +    typedef ElemTemplateElement ParentType;
  +
        /**
         * Construct an object corresponding to an "xsl:template" element
         * 
  @@ -121,6 +123,12 @@
   
        virtual const XPath*
        getXPath(unsigned int   index = 0) const;
  +
  +    void
  +    executeAsNamed(StylesheetExecutionContext&  executionContext) const
  +    {
  +         ParentType::executeChildren(executionContext);
  +    }
   
   private:
   
  
  
  
  1.11      +3 -2      xml-xalan/c/src/xalanc/XSLT/ElemTemplateElement.cpp
  
  Index: ElemTemplateElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/ElemTemplateElement.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemTemplateElement.cpp   26 Feb 2004 22:58:57 -0000      1.10
  +++ ElemTemplateElement.cpp   27 Mar 2004 02:11:03 -0000      1.11
  @@ -614,9 +614,10 @@
                // element...
                const bool                      isApplyImports = 
xslInstruction.getXSLToken() ==
                        StylesheetConstructionContext::ELEMNAME_APPLY_IMPORTS;
  +        assert(isApplyImports == false || 
executionContext.getCurrentTemplate() != 0);
   
  -             const Stylesheet*       stylesheetTree = isApplyImports ?
  -                                                             
&xslInstruction.getStylesheet() :
  +             const Stylesheet*       stylesheetTree = isApplyImports == true 
?
  +                                                             
&executionContext.getCurrentTemplate()->getStylesheet() :
                                                                
&getStylesheet().getStylesheetRoot();
   
                theTemplate = stylesheetTree->findTemplate(
  
  
  
  1.23      +13 -8     
xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StylesheetExecutionContextDefault.cpp     13 Mar 2004 00:44:55 -0000      
1.22
  +++ StylesheetExecutionContextDefault.cpp     27 Mar 2004 02:11:03 -0000      
1.23
  @@ -139,6 +139,7 @@
        m_escapeURLs(eEscapeURLsDefault),
        m_omitMETATag(eOmitMETATagDefault)
   {
  +    m_currentTemplateStack.push_back(0);
   }
   
   
  @@ -179,6 +180,7 @@
        m_cloneTextNodesOnly(false),
        m_escapeURLs(eEscapeURLsDefault)
   {
  +    m_currentTemplateStack.push_back(0);
   }
   
   
  @@ -1614,15 +1616,16 @@
   
   void 
   StylesheetExecutionContextDefault::formatNumber(
  -                     double                                                  
        number,
  -                     const XalanDOMString&                           pattern,
  -                     const XalanDOMString&                           dfsName,
  -                     XalanDOMString&                                         
theResult,
  -                     const XalanNode*                                        
context,
  -                     const LocatorType*                                      
locator)
  +                     double                                  number,
  +                     const XalanDOMString&   pattern,
  +                     const XalanDOMString&   dfsName,
  +                     XalanDOMString&                 theResult,
  +                     const XalanNode*                context,
  +                     const LocatorType*              locator)
   {
        XalanQNameByValue&      theDFSQName = 
m_xpathExecutionContextDefault.getScratchQName();
  -     theDFSQName.set(dfsName, getPrefixResolver(), locator);
  +
  +    theDFSQName.set(dfsName, getPrefixResolver(), locator);
   
        const XalanDecimalFormatSymbols*        theDFS = 
getDecimalFormatSymbols(theDFSQName);
   
  @@ -1664,7 +1667,8 @@
   
   
   StylesheetExecutionContextDefault::FormatNumberFunctor*
  -StylesheetExecutionContextDefault::uninstallFormatNumberFunctor() {
  +StylesheetExecutionContextDefault::uninstallFormatNumberFunctor()
  +{
        if (m_formatNumberFunctor == 0)
        {
                return 0;
  @@ -1722,6 +1726,7 @@
        m_mode = 0;
   
        m_currentTemplateStack.clear();
  +    m_currentTemplateStack.push_back(0);
   
        m_formatterToTextCache.reset();
        m_formatterToSourceTreeCache.reset();
  
  
  

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

Reply via email to