dbertoni    2003/01/07 22:59:58

  Modified:    c/src/XSLT AVT.cpp AVT.hpp AVTPart.hpp AVTPartSimple.cpp
                        AVTPartSimple.hpp AVTPartXPath.cpp AVTPartXPath.hpp
                        ElemApplyImport.cpp ElemApplyTemplates.cpp
                        ElemAttribute.cpp ElemChoose.cpp ElemCopyOf.cpp
                        ElemElement.cpp ElemForEach.cpp ElemForEach.hpp
                        ElemIf.cpp ElemLiteralResult.cpp ElemNumber.cpp
                        ElemNumber.hpp ElemPI.cpp ElemTemplateElement.cpp
                        ElemValueOf.cpp ElemVariable.cpp
  Log:
  Changes to avoid constant setting of context node.
  
  Revision  Changes    Path
  1.21      +19 -2     xml-xalan/c/src/XSLT/AVT.cpp
  
  Index: AVT.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVT.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AVT.cpp   25 Nov 2002 18:11:51 -0000      1.20
  +++ AVT.cpp   8 Jan 2003 06:59:56 -0000       1.21
  @@ -330,8 +330,6 @@
                        const PrefixResolver&   prefixResolver,
                        XPathExecutionContext&  executionContext) const
   {
  -     clear(buf);
  -
        if(m_partsSize != 0)
        {
                for(size_type i = 0; i < m_partsSize; i++)
  @@ -339,6 +337,25 @@
                        assert(m_parts[i] != 0);
   
                        m_parts[i]->evaluate(buf, contextNode, prefixResolver, 
executionContext);
  +             }
  +     }
  +}
  +
  +
  +
  +void
  +AVT::doEvaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const
  +{
  +     if(m_partsSize != 0)
  +     {
  +             for(size_type i = 0; i < m_partsSize; i++)
  +             {
  +                     assert(m_parts[i] != 0);
  +
  +                     m_parts[i]->evaluate(buf, prefixResolver, 
executionContext);
                }
        }
   }
  
  
  
  1.18      +37 -0     xml-xalan/c/src/XSLT/AVT.hpp
  
  Index: AVT.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVT.hpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AVT.hpp   25 Nov 2002 18:11:51 -0000      1.17
  +++ AVT.hpp   8 Jan 2003 06:59:56 -0000       1.18
  @@ -132,6 +132,14 @@
                return m_name;
        }
   
  +     /**
  +      * Append the value to the buffer.
  +      *
  +      * @param buf              buffer to write into
  +      * @param contextNode      current context node
  +      * @param prefixResolver   prefix resolver to use
  +      * @param executionContext execution context
  +      */
        void
        evaluate(
                        XalanDOMString&                 buf,
  @@ -149,7 +157,36 @@
                }
        }
   
  +     /**
  +      * Append the value to the buffer.
  +      *
  +      * @param buf              buffer to write into
  +      * @param prefixResolver   prefix resolver to use
  +      * @param executionContext execution context
  +      */
  +     void
  +     evaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const
  +     {
  +             if(m_simpleString != 0)
  +             {
  +                     buf.assign(m_simpleString, m_simpleStringLength);
  +             }
  +             else
  +             {
  +                     doEvaluate(buf, prefixResolver, executionContext);
  +             }
  +     }
  +
   private:
  +
  +     void
  +     doEvaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const;
   
        void
        doEvaluate(
  
  
  
  1.7       +15 -2     xml-xalan/c/src/XSLT/AVTPart.hpp
  
  Index: AVTPart.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPart.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AVTPart.hpp       25 Nov 2002 18:11:51 -0000      1.6
  +++ AVTPart.hpp       8 Jan 2003 06:59:56 -0000       1.7
  @@ -94,7 +94,7 @@
        ~AVTPart();
   
        /**
  -      * Write the value into the buffer.
  +      * Append the value to the buffer.
         *
         * @param buf              buffer to write into
         * @param contextNode      current context node
  @@ -105,6 +105,19 @@
        evaluate(
                        XalanDOMString&                 buf,
                        XalanNode*                              contextNode,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const = 0;
  +
  +     /**
  +      * Append the value to the buffer.
  +      *
  +      * @param buf              buffer to write into
  +      * @param prefixResolver   prefix resolver to use
  +      * @param executionContext execution context
  +      */
  +     virtual void
  +     evaluate(
  +                     XalanDOMString&                 buf,
                        const PrefixResolver&   prefixResolver,
                        XPathExecutionContext&  executionContext) const = 0;
   };
  
  
  
  1.7       +12 -0     xml-xalan/c/src/XSLT/AVTPartSimple.cpp
  
  Index: AVTPartSimple.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPartSimple.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AVTPartSimple.cpp 25 Nov 2002 18:11:51 -0000      1.6
  +++ AVTPartSimple.cpp 8 Jan 2003 06:59:56 -0000       1.7
  @@ -98,4 +98,16 @@
   
   
   
  +void
  +AVTPartSimple::evaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   /* prefixResolver */,
  +                     XPathExecutionContext&  /* executionContext */) const
  +
  +{
  +     append(buf, m_val, m_len);
  +}
  +
  +
  +
   XALAN_CPP_NAMESPACE_END
  
  
  
  1.8       +7 -1      xml-xalan/c/src/XSLT/AVTPartSimple.hpp
  
  Index: AVTPartSimple.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPartSimple.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AVTPartSimple.hpp 25 Nov 2002 18:11:51 -0000      1.7
  +++ AVTPartSimple.hpp 8 Jan 2003 06:59:56 -0000       1.8
  @@ -114,6 +114,12 @@
                        const PrefixResolver&   prefixResolver,
                        XPathExecutionContext&  executionContext) const;
   
  +     virtual void
  +     evaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const;
  +
   private:
   
        /**
  
  
  
  1.11      +11 -0     xml-xalan/c/src/XSLT/AVTPartXPath.cpp
  
  Index: AVTPartXPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPartXPath.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AVTPartXPath.cpp  2 Jan 2003 17:39:18 -0000       1.10
  +++ AVTPartXPath.cpp  8 Jan 2003 06:59:56 -0000       1.11
  @@ -94,4 +94,15 @@
   
   
   
  +void
  +AVTPartXPath::evaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const
  +{
  +     m_pXPath->execute(prefixResolver, executionContext, buf);
  +}
  +
  +
  +
   XALAN_CPP_NAMESPACE_END
  
  
  
  1.9       +7 -1      xml-xalan/c/src/XSLT/AVTPartXPath.hpp
  
  Index: AVTPartXPath.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/AVTPartXPath.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AVTPartXPath.hpp  2 Jan 2003 17:39:18 -0000       1.8
  +++ AVTPartXPath.hpp  8 Jan 2003 06:59:56 -0000       1.9
  @@ -113,6 +113,12 @@
                        const PrefixResolver&   prefixResolver,
                        XPathExecutionContext&  executionContext) const;
   
  +     virtual void
  +     evaluate(
  +                     XalanDOMString&                 buf,
  +                     const PrefixResolver&   prefixResolver,
  +                     XPathExecutionContext&  executionContext) const;
  +
   private:
   
        /**
  
  
  
  1.21      +1 -1      xml-xalan/c/src/XSLT/ElemApplyImport.cpp
  
  Index: ElemApplyImport.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemApplyImport.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ElemApplyImport.cpp       27 Nov 2002 19:40:28 -0000      1.20
  +++ ElemApplyImport.cpp       8 Jan 2003 06:59:56 -0000       1.21
  @@ -135,7 +135,7 @@
   
        ElemTemplateElement::execute(executionContext);
   
  -     const StylesheetExecutionContext::PushAndPopContextMarker       
thePusPop(executionContext);
  +     const StylesheetExecutionContext::PushAndPopContextMarker       
thePushPop(executionContext);
   
        transformChild(
                        executionContext,
  
  
  
  1.30      +0 -2      xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp
  
  Index: ElemApplyTemplates.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemApplyTemplates.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ElemApplyTemplates.cpp    25 Nov 2002 18:11:52 -0000      1.29
  +++ ElemApplyTemplates.cpp    8 Jan 2003 06:59:56 -0000       1.30
  @@ -193,7 +193,6 @@
                transformSelectedChildren(
                                executionContext,
                                0,
  -                             sourceNode,
                                thePushPop.getStackFrameIndex());
   
                executionContext.setCurrentMode(currentMode);
  @@ -203,7 +202,6 @@
                transformSelectedChildren(
                                executionContext,
                                0,
  -                             sourceNode,
                                thePushPop.getStackFrameIndex());
        }
   }
  
  
  
  1.44      +5 -7      xml-xalan/c/src/XSLT/ElemAttribute.cpp
  
  Index: ElemAttribute.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemAttribute.cpp,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- ElemAttribute.cpp 25 Nov 2002 18:11:52 -0000      1.43
  +++ ElemAttribute.cpp 8 Jan 2003 06:59:56 -0000       1.44
  @@ -158,15 +158,13 @@
   
        XalanDOMString&         attrName = attrNameGuard.get();
   
  -     XalanNode* sourceNode = executionContext.getCurrentNode();
  -
  -     m_nameAVT->evaluate(attrName, sourceNode, *this, executionContext);
  +     m_nameAVT->evaluate(attrName, *this, executionContext);
   
        if(XalanQName::isValidQName(attrName) == false)
        {
                executionContext.warn(
                        "The attribute name is invalid",
  -                     sourceNode,
  +                     executionContext.getCurrentNode(),
                        getLocator());
        }
        else
  @@ -188,7 +186,7 @@
   
                if(0 != m_namespaceAVT)
                {
  -                     m_namespaceAVT->evaluate(attrNameSpace, sourceNode, 
*this, executionContext);
  +                     m_namespaceAVT->evaluate(attrNameSpace, *this, 
executionContext);
   
                        indexOfNSSep = indexOf(origAttrName, 
XalanUnicode::charColon);
   
  @@ -350,7 +348,7 @@
                                                // Could not resolve prefix
                                                executionContext.warn(
                                                        "Warning: Could not 
resolve prefix",
  -                                                     sourceNode,
  +                                                     
executionContext.getCurrentNode(),
                                                        getLocator());
                                        }
                                        else
  @@ -383,7 +381,7 @@
                {
                        executionContext.warn(
                                "Attributes cannot be added after a child has 
been added.  The attribute(s) will not be added",
  -                             sourceNode,
  +                             executionContext.getCurrentNode(),
                                getLocator());
                }
   
  
  
  
  1.22      +1 -1      xml-xalan/c/src/XSLT/ElemChoose.cpp
  
  Index: ElemChoose.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemChoose.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ElemChoose.cpp    2 Jan 2003 17:39:18 -0000       1.21
  +++ ElemChoose.cpp    8 Jan 2003 06:59:56 -0000       1.22
  @@ -147,7 +147,7 @@
   
                        bool    test;
   
  -                     theXPath->execute(sourceNode, *this, executionContext, 
test);
  +                     theXPath->execute(*this, executionContext, test);
   
                        if(0 != executionContext.getTraceListeners())
                        {
  
  
  
  1.31      +1 -1      xml-xalan/c/src/XSLT/ElemCopyOf.cpp
  
  Index: ElemCopyOf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemCopyOf.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ElemCopyOf.cpp    25 Nov 2002 18:11:52 -0000      1.30
  +++ ElemCopyOf.cpp    8 Jan 2003 06:59:56 -0000       1.31
  @@ -175,7 +175,7 @@
        }
        else
        {
  -             const XObjectPtr        
value(m_selectPattern->execute(sourceNode, *this, executionContext));
  +             const XObjectPtr        value(m_selectPattern->execute(*this, 
executionContext));
                assert(value.null() == false);
   
                if(0 != executionContext.getTraceListeners())
  
  
  
  1.46      +5 -7      xml-xalan/c/src/XSLT/ElemElement.cpp
  
  Index: ElemElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemElement.cpp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- ElemElement.cpp   25 Nov 2002 18:11:52 -0000      1.45
  +++ ElemElement.cpp   8 Jan 2003 06:59:56 -0000       1.46
  @@ -155,9 +155,7 @@
   
        XalanDOMString&         elemName = elemNameGuard.get();
   
  -     XalanNode* const        sourceNode = executionContext.getCurrentNode();
  -
  -     m_nameAVT->evaluate(elemName, sourceNode, *this, executionContext);
  +     m_nameAVT->evaluate(elemName, *this, executionContext);
   
        bool    isIllegalElement = !XalanQName::isValidQName(elemName);
   
  @@ -165,7 +163,7 @@
        {
                executionContext.warn(
                        "Illegal element name",
  -                     sourceNode,
  +                     executionContext.getCurrentNode(),
                        getLocator());
   
                ElemUse::doExecute(executionContext, false);
  @@ -180,7 +178,7 @@
   
                if (m_namespaceAVT != 0)
                {
  -                     m_namespaceAVT->evaluate(elemNameSpace, sourceNode, 
*this, executionContext);
  +                     m_namespaceAVT->evaluate(elemNameSpace, *this, 
executionContext);
                }
   
                XalanDOMString::size_type       namespaceLen = 
length(elemNameSpace);
  @@ -219,7 +217,7 @@
                                {
                                        executionContext.warn(
                                                "Could not resolve prefix",
  -                                             sourceNode,
  +                                             
executionContext.getCurrentNode(),
                                                getLocator());
   
                                        if (m_namespaceAVT != 0)
  @@ -234,7 +232,7 @@
   
                                                executionContext.warn(
                                                        "Illegal element name",
  -                                                     sourceNode,
  +                                                     
executionContext.getCurrentNode(),
                                                        getLocator());
                                        }
                                }
  
  
  
  1.33      +15 -32    xml-xalan/c/src/XSLT/ElemForEach.cpp
  
  Index: ElemForEach.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemForEach.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ElemForEach.cpp   2 Jan 2003 17:39:18 -0000       1.32
  +++ ElemForEach.cpp   8 Jan 2003 06:59:56 -0000       1.33
  @@ -215,28 +215,16 @@
   ElemForEach::execute(StylesheetExecutionContext&     executionContext) const
   {
        assert(m_selectPattern != 0);
  +     assert(executionContext.getCurrentNode() != 0);
   
        StylesheetExecutionContext::SetAndRestoreCurrentTemplate        
theSetAndRestore(executionContext, 0);
   
        if (hasChildren() == true)
        {
  -             XalanNode* const        sourceNode = 
executionContext.getCurrentNode();
  -
  -             if (sourceNode != 0)
  -             {
  -                     transformSelectedChildren(
  -                             executionContext,
  -                             this,
  -                             sourceNode,
  -                             executionContext.getCurrentStackFrameIndex());
  -             }
  -             else
  -             {
  -                     executionContext.error(
  -                             "There is no current node in 
ElemForEach::execute()",
  -                             sourceNode, 
  -                             getLocator());
  -             }
  +             transformSelectedChildren(
  +                     executionContext,
  +                     this,
  +                     executionContext.getCurrentStackFrameIndex());
        }
   }
   
  @@ -246,7 +234,6 @@
   ElemForEach::transformSelectedChildren(
                        StylesheetExecutionContext&             
executionContext,
                        const ElemTemplateElement*              theTemplate,
  -                     XalanNode*                                              
sourceNodeContext,
                        int                                                     
        selectStackFrameIndex) const
   {
        assert(m_selectPattern != 0);
  @@ -257,7 +244,6 @@
                transformSelectedChildren(
                                        executionContext,
                                        theTemplate,
  -                                     sourceNodeContext,
                                        0,
                                        selectStackFrameIndex);
        }
  @@ -296,14 +282,14 @@
   
                        if(0 != avt)
                        {
  -                             avt->evaluate(langString, sourceNodeContext, 
*this, executionContext);
  +                             avt->evaluate(langString, *this, 
executionContext);
                        }
   
                        avt = sort->getDataTypeAVT();
   
                        if(0 != avt)
                        {
  -                             avt->evaluate(scratchString, sourceNodeContext, 
*this, executionContext);
  +                             avt->evaluate(scratchString, *this, 
executionContext);
                        }                       
   
                        bool    treatAsNumbers = false;
  @@ -322,14 +308,14 @@
                                        {
                                                executionContext.error(
                                                        "xsl:sort data-type 
must be 'text', 'number' or a prefixed name",
  -                                                     sourceNodeContext,
  +                                                     
executionContext.getCurrentNode(),
                                                        sort->getLocator());
                                        }
                                        else
                                        {
                                                executionContext.warn(
                                                        "xsl:sort has an 
unknown data-type.  The data-type will be 'text'",
  -                                                     sourceNodeContext,
  +                                                     
executionContext.getCurrentNode(),
                                                        sort->getLocator());
                                        }
                                }
  @@ -341,7 +327,7 @@
   
                        if(0 != avt)
                        {
  -                             avt->evaluate(scratchString, sourceNodeContext, 
*this, executionContext);
  +                             avt->evaluate(scratchString, *this, 
executionContext);
                        }                       
   
                        bool    descending = false;
  @@ -356,7 +342,7 @@
                                {
                                        executionContext.error(
                                                "xsl:sort order must be 
'ascending' or 'descending'",
  -                                             sourceNodeContext,
  +                                             
executionContext.getCurrentNode(),
                                                sort->getLocator());
                                }
                        }
  @@ -367,7 +353,7 @@
   
                        if(0 != avt)
                        {
  -                             avt->evaluate(scratchString, sourceNodeContext, 
*this, executionContext);
  +                             avt->evaluate(scratchString, *this, 
executionContext);
                        }                       
   
                        NodeSortKey::eCaseOrder         caseOrder = 
NodeSortKey::eDefault;
  @@ -386,7 +372,7 @@
                                {
                                        executionContext.error(
                                                "xsl:sort case-order must be 
'upper-first' or 'lower-first'",
  -                                             sourceNodeContext,
  +                                             
executionContext.getCurrentNode(),
                                                sort->getLocator());
                                }
                        }
  @@ -409,7 +395,6 @@
                transformSelectedChildren(
                                        executionContext,
                                        theTemplate,
  -                                     sourceNodeContext,
                                        sorter.get(),
                                        selectStackFrameIndex);
        }
  @@ -421,7 +406,6 @@
   ElemForEach::transformSelectedChildren(
                        StylesheetExecutionContext&             
executionContext,
                        const ElemTemplateElement*              theTemplate,
  -                     XalanNode*                                              
sourceNodeContext,
                        NodeSorter*                                             
sorter,
                        int                                                     
        selectStackFrameIndex) const
   {
  @@ -443,7 +427,6 @@
                                        selectStackFrameIndex);
   
                xobjectResult = m_selectPattern->execute(
  -                                             sourceNodeContext,
                                                *this,
                                                executionContext,
                                                *theGuard);
  @@ -465,7 +448,7 @@
                executionContext.fireSelectEvent(
                                SelectionEvent(
                                        executionContext, 
  -                                     sourceNodeContext,
  +                                     executionContext.getCurrentNode(),
                                        *this,
                                        
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("select")),
                                        *m_selectPattern,
  @@ -535,7 +518,7 @@
        }
   
        // Create an object to set and restore the context node list...
  -     StylesheetExecutionContext::ContextNodeListSetAndRestore        
theSetAndRestore(
  +     const StylesheetExecutionContext::ContextNodeListSetAndRestore  
theContextNodeListSetAndRestore(
                                executionContext,
                                sourceNodes);
   
  
  
  
  1.17      +1 -3      xml-xalan/c/src/XSLT/ElemForEach.hpp
  
  Index: ElemForEach.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemForEach.hpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ElemForEach.hpp   25 Nov 2002 18:11:52 -0000      1.16
  +++ ElemForEach.hpp   8 Jan 2003 06:59:56 -0000       1.17
  @@ -173,7 +173,6 @@
        transformSelectedChildren(
                        StylesheetExecutionContext&             
executionContext,
                        const ElemTemplateElement*              theTemplate,
  -                     XalanNode*                                              
sourceNodeContext,
                        int                                                     
        selectStackFrameIndex) const;
   
        /**
  @@ -181,7 +180,7 @@
         * 
         * @param executionContext      The current execution context
         * @param template The owning template context.
  -      * @param sourceNodeContext The current source node context.
  +      * @param sorter The NodeSorter instance, if any.
         * @param selectStackFrameIndex stack frame context for executing the
         *                                                              select 
statement
         */
  @@ -189,7 +188,6 @@
        transformSelectedChildren(
                        StylesheetExecutionContext&     executionContext,
                        const ElemTemplateElement*              theTemplate,
  -                     XalanNode*                                              
sourceNodeContext,
                        NodeSorter*                                     sorter,
                        int                                                     
selectStackFrameIndex) const;
   
  
  
  
  1.24      +2 -4      xml-xalan/c/src/XSLT/ElemIf.cpp
  
  Index: ElemIf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemIf.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ElemIf.cpp        2 Jan 2003 17:39:18 -0000       1.23
  +++ ElemIf.cpp        8 Jan 2003 06:59:56 -0000       1.24
  @@ -143,17 +143,15 @@
   
        ElemTemplateElement::execute(executionContext);
   
  -     XalanNode* sourceNode = executionContext.getCurrentNode();
  -
        bool    fResult;
   
  -     m_test->execute(sourceNode, *this, executionContext, fResult);
  +     m_test->execute(*this, executionContext, fResult);
   
        if(0 != executionContext.getTraceListeners())
        {
                executionContext.fireSelectEvent(
                        SelectionEvent(executionContext,
  -                     sourceNode,
  +                     executionContext.getCurrentNode(),
                        *this,
                        
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("test")),
                        *m_test,
  
  
  
  1.61      +3 -1      xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
  
  Index: ElemLiteralResult.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ElemLiteralResult.cpp     25 Nov 2002 18:11:52 -0000      1.60
  +++ ElemLiteralResult.cpp     8 Jan 2003 06:59:56 -0000       1.61
  @@ -390,9 +390,11 @@
   
                        const XalanDOMString&   theName = avt->getName();
   
  -                     avt->evaluate(theStringedValue, 
executionContext.getCurrentNode(), *this, executionContext);
  +                     avt->evaluate(theStringedValue, *this, 
executionContext);
   
                        executionContext.addResultAttribute(theName, 
theStringedValue);
  +
  +                     theStringedValue.clear();
                }
        }
   
  
  
  
  1.72      +10 -32    xml-xalan/c/src/XSLT/ElemNumber.cpp
  
  Index: ElemNumber.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.cpp,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- ElemNumber.cpp    2 Jan 2003 17:39:18 -0000       1.71
  +++ ElemNumber.cpp    8 Jan 2003 06:59:56 -0000       1.72
  @@ -344,9 +344,6 @@
   
                        if (isEmpty(theNamespaceURI) == true)
                        {
  -                             // No namespace URI means no prefix, so this is 
easy...
  -//                           assert(isEmpty(contextNode->getLocalName()) == 
true);
  -
                                // We can pass any PrefixResolver instance, so 
just
                                // pass ourself...
                                countMatchPattern =
  @@ -466,7 +463,6 @@
   inline void
   ElemNumber::getCountString(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
sourceNode,
                        const MutableNodeRefList&               ancestors,
                        CountersTable&                                  ctable,
                        CountType                                               
numberList[],
  @@ -487,7 +483,6 @@
                        executionContext,
                        numberList,
                        numberListLength,
  -                     sourceNode,
                        theResult);
   }
   
  @@ -506,7 +501,7 @@
        {
                double  theValue;
   
  -             m_valueExpr->execute(sourceNode, *this, executionContext, 
theValue);
  +             m_valueExpr->execute(*this, executionContext, theValue);
   
                CountType       theNumber = 0;
   
  @@ -519,7 +514,6 @@
                                executionContext,
                                &theNumber,
                                1,
  -                             sourceNode,
                                theResult);
        }
        else
  @@ -535,7 +529,6 @@
                                executionContext,
                                &theNumber,
                                1,
  -                             sourceNode,
                                theResult);
                }
                else
  @@ -562,7 +555,6 @@
   
                                        getCountString(
                                                executionContext,
  -                                             sourceNode,
                                                *ancestors.get(),
                                                ctable,
                                                numberList,
  @@ -577,7 +569,6 @@
   
                                        getCountString(
                                                executionContext,
  -                                             sourceNode,
                                                *ancestors.get(),
                                                ctable,
                                                &*numberList.begin(),
  @@ -796,9 +787,7 @@
   
   
   XalanNumberFormat*
  -ElemNumber::getNumberFormatter(
  -                     StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode) const
  +ElemNumber::getNumberFormatter(StylesheetExecutionContext&   
executionContext) const
   {
       // Helper to format local specific numbers to strings.
        XalanAutoPtr<XalanNumberFormat>         
formatter(executionContext.createXalanNumberFormat());
  @@ -810,14 +799,13 @@
        XalanDOMString&                         digitGroupSepValue = 
theGuard1.get();
   
        if (0 != m_groupingSeparator_avt)
  -             m_groupingSeparator_avt->evaluate(digitGroupSepValue, 
contextNode,
  -                              *this, executionContext);
  +             m_groupingSeparator_avt->evaluate(digitGroupSepValue, *this, 
executionContext);
                                                                         
        if (length(digitGroupSepValue) > 1)
        {
                executionContext.error(
                        "The grouping-separator value must be one character in 
length",
  -                     contextNode,
  +                     executionContext.getCurrentNode(),
                        getLocator());
        }
   
  @@ -826,10 +814,8 @@
        XalanDOMString&                         nDigitsPerGroupValue = 
theGuard2.get();
   
        if (0 != m_groupingSize_avt)
  -             m_groupingSize_avt->evaluate(nDigitsPerGroupValue, contextNode, 
*this,
  -                             executionContext);
  +             m_groupingSize_avt->evaluate(nDigitsPerGroupValue, *this, 
executionContext);
   
  -    // TODO: Handle digit-group attributes
        // 7.7.1 If one is empty, it is ignored (numb81 conf test)
        if(!isEmpty(digitGroupSepValue) && !isEmpty(nDigitsPerGroupValue))
        {
  @@ -848,14 +834,10 @@
                        StylesheetExecutionContext&             
executionContext,
                        const CountType                                 
theList[],
                        NodeRefListBase::size_type              theListLength,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMString&                                 
theResult) const
   {
        assert(theListLength > 0);
   
  -     // Pathological cases
  -     if (contextNode == 0) return;
  -
        XalanDOMChar    numberType = XalanUnicode::charDigit_1;
   
        XalanDOMString::size_type       numberWidth = 1;
  @@ -883,7 +865,7 @@
   
                if (m_format_avt != 0)
                {
  -                      m_format_avt->evaluate(formatValue, contextNode, 
*this, executionContext);
  +                      m_format_avt->evaluate(formatValue, *this, 
executionContext);
                }
   
                if(isEmpty(formatValue) == true)
  @@ -979,7 +961,6 @@
   
                getFormattedNumber(
                                executionContext,
  -                             contextNode,
                                numberType,
                                numberWidth,
                                theList[i],
  @@ -1014,7 +995,6 @@
   void
   ElemNumber::evaluateLetterValueAVT(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMString&                                 value) 
const
   {
        if (m_lettervalue_avt == 0)
  @@ -1025,7 +1005,6 @@
        {
                m_lettervalue_avt->evaluate(
                                value,
  -                             contextNode,
                                *this,
                                executionContext);
        }
  @@ -1302,7 +1281,6 @@
   void
   ElemNumber::getFormattedNumber(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMChar                                    
numberType,
                        XalanDOMString::size_type               numberWidth,
                        CountType                                               
listElement,
  @@ -1342,7 +1320,7 @@
                case 0x0430:
                        executionContext.error(
                                "Numbering format not supported yet",
  -                             contextNode,
  +                             executionContext.getCurrentNode(),
                                getLocator());
                        break;
   
  @@ -1353,7 +1331,7 @@
   
                                XalanDOMString&         letterVal = 
theGuard.get();
   
  -                             evaluateLetterValueAVT(executionContext, 
contextNode, letterVal);
  +                             evaluateLetterValueAVT(executionContext, 
letterVal);
   
                                if (equals(letterVal, s_traditionalString) == 
true)
                                {
  @@ -1367,7 +1345,7 @@
                                {
                                        executionContext.error(
                                                "The legal values for 
letter-value are 'alphabetic' and 'traditional'",
  -                                             contextNode,
  +                                             
executionContext.getCurrentNode(),
                                                getLocator());
                                }
                        }
  @@ -1376,7 +1354,7 @@
                default: // "1"
                        {
                                
StylesheetExecutionContext::XalanNumberFormatAutoPtr    formatter(
  -                                             
getNumberFormatter(executionContext, contextNode));
  +                                             
getNumberFormatter(executionContext));
   
                                formatter->format(listElement, theResult);
   
  
  
  
  1.45      +1 -9      xml-xalan/c/src/XSLT/ElemNumber.hpp
  
  Index: ElemNumber.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemNumber.hpp,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- ElemNumber.hpp    25 Nov 2002 18:11:52 -0000      1.44
  +++ ElemNumber.hpp    8 Jan 2003 06:59:56 -0000       1.45
  @@ -233,7 +233,6 @@
        void
        getCountString(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
sourceNode,
                        const MutableNodeRefList&               ancestors,
                        CountersTable&                                  ctable,
                        CountType                                               
numberList[],
  @@ -260,13 +259,10 @@
        /**
         * Get a formatter.
         * @param executionContext The current execution context.
  -      * @param contextNode The current context node.
         * @return A new XalanNumberFormat instance.  The caller owns the 
memory.
         */
        XalanNumberFormat*
  -     getNumberFormatter(
  -                     StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode) const;
  +     getNumberFormatter(StylesheetExecutionContext&          
executionContext) const;
   
        /**
         * Format an array of integrals into a formatted string.
  @@ -274,7 +270,6 @@
         * @param executionContext The current execution context.
         * @param theList Array of one or more integer numbers.
         * @param theListLength The length of the array.
  -      * @param contextNode The context node.
         * @param formattedNumber The formatted number result.
         */
        void
  @@ -282,7 +277,6 @@
                        StylesheetExecutionContext&             
executionContext,
                        const CountType                                 
theList[],
                        NodeRefListBase::size_type              theListLength,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMString&                                 
formattedNumber) const;
   
        /**
  @@ -356,7 +350,6 @@
        void
        evaluateLetterValueAVT(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMString&                                 value) 
const;
   
        void
  @@ -371,7 +364,6 @@
        void
        getFormattedNumber(
                        StylesheetExecutionContext&             
executionContext,
  -                     XalanNode*                                              
contextNode,
                        XalanDOMChar                                    
numberType,
                        XalanDOMString::size_type               numberWidth,
                        CountType                                               
listElement,
  
  
  
  1.27      +5 -4      xml-xalan/c/src/XSLT/ElemPI.cpp
  
  Index: ElemPI.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemPI.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ElemPI.cpp        25 Nov 2002 18:11:52 -0000      1.26
  +++ ElemPI.cpp        8 Jan 2003 06:59:56 -0000       1.27
  @@ -140,10 +140,11 @@
   {
        ElemTemplateElement::execute(executionContext);
        
  -     XalanDOMString  piName;
  -     XalanNode* sourceNode = executionContext.getCurrentNode();
  -     
  -     m_nameAVT->evaluate(piName, sourceNode, *this, executionContext);
  +     StylesheetExecutionContext::GetAndReleaseCachedString   
theGuard(executionContext);
  +
  +     XalanDOMString&         piName = theGuard.get();
  +
  +     m_nameAVT->evaluate(piName, *this, executionContext);
   
        if(equalsIgnoreCaseASCII(piName, Constants::ATTRVAL_OUTPUT_METHOD_XML))
        {
  
  
  
  1.90      +12 -4     xml-xalan/c/src/XSLT/ElemTemplateElement.cpp
  
  Index: ElemTemplateElement.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemTemplateElement.cpp,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- ElemTemplateElement.cpp   21 Dec 2002 00:21:25 -0000      1.89
  +++ ElemTemplateElement.cpp   8 Jan 2003 06:59:56 -0000       1.90
  @@ -306,9 +306,18 @@
   {
        if (hasChildren() == true)
        {
  -             const XPathExecutionContext::CurrentNodeSetAndRestore   
theCurrentNodeSetAndRestore(executionContext, sourceNode);
  +             XalanNode* const        theCurrentNode = 
executionContext.getCurrentNode();
  +             
  +             if (theCurrentNode == sourceNode)
  +             {
  +                     executeChildren(executionContext);
  +             }
  +             else
  +             {
  +                     const XPathExecutionContext::CurrentNodeSetAndRestore   
theCurrentNodeSetAndRestore(executionContext, theCurrentNode, sourceNode);
   
  -             executeChildren(executionContext);
  +                     executeChildren(executionContext);
  +             }
        }
   }
   
  @@ -694,8 +703,7 @@
                                executionContext.fireTraceEvent(te);
                        }
   
  -                     theTemplate->executeChildren(executionContext, 
  -                                                                             
 child);
  +                     theTemplate->executeChildren(executionContext, child);
                }
        }
   
  
  
  
  1.36      +1 -1      xml-xalan/c/src/XSLT/ElemValueOf.cpp
  
  Index: ElemValueOf.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemValueOf.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ElemValueOf.cpp   2 Jan 2003 17:39:18 -0000       1.35
  +++ ElemValueOf.cpp   8 Jan 2003 06:59:57 -0000       1.36
  @@ -308,7 +308,7 @@
                XPath::MemberFunctionPtr        theFunction = 
disableOutputEscaping() == false ?
                        &FormatterListener::characters : 
&FormatterListener::charactersRaw;
   
  -             m_selectPattern->execute(sourceNode, *this, executionContext, 
theAdapter, theFunction);
  +             m_selectPattern->execute(*this, executionContext, theAdapter, 
theFunction);
   
                if(0 != executionContext.getTraceListeners())
                {
  
  
  
  1.30      +14 -1     xml-xalan/c/src/XSLT/ElemVariable.cpp
  
  Index: ElemVariable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemVariable.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ElemVariable.cpp  25 Nov 2002 18:11:52 -0000      1.29
  +++ ElemVariable.cpp  8 Jan 2003 06:59:57 -0000       1.30
  @@ -294,7 +294,20 @@
        }
        else
        {
  -             const XObjectPtr        
theValue(m_selectPattern->execute(sourceNode, *this, executionContext));
  +             XObjectPtr      theValue;
  +
  +             XalanNode* const        theCurrentNode = 
executionContext.getCurrentNode();
  +             
  +             if (theCurrentNode == sourceNode)
  +             {
  +                     theValue = m_selectPattern->execute(*this, 
executionContext);
  +             }
  +             else
  +             {
  +                     const XPathExecutionContext::CurrentNodeSetAndRestore   
theCurrentNodeSetAndRestore(executionContext, theCurrentNode, sourceNode);
  +
  +                     theValue = m_selectPattern->execute(*this, 
executionContext);
  +             }
   
                if(0 != executionContext.getTraceListeners())
                {
  
  
  

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

Reply via email to