sboag       00/12/20 18:11:23

  Modified:    java/src/org/apache/xalan/templates ElemApplyTemplates.java
                        ElemForEach.java
  Log:
  The parameters now work like this:
  1) Before an apply-template loop (i.e. outside the loop)
  push all the params on
  the current frame.  Each Arg is marked as being a param.
  2) When ElemParam executes, if a real parameter is found on
  the stack, mark it as *not* being a param, else execute it as a
  variable for the default value.
  3) When the variable stack looks for a variable, it doesn't
  return those marked as a parameter.  Thus it won't return
  parameters that are marked as parameters, given #2.
  4) after the template has executed, remark all the parameters
  as parameters, and go back to #2 in the next itteration of the
  loop.
  
  Revision  Changes    Path
  1.11      +10 -0     
xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java
  
  Index: ElemApplyTemplates.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemApplyTemplates.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ElemApplyTemplates.java   2000/12/20 05:02:21     1.10
  +++ ElemApplyTemplates.java   2000/12/21 02:11:23     1.11
  @@ -247,6 +247,16 @@
        
       return savedSearchStart;
     }
  +  
  +  /**
  +   * Re-mark the params as params.
  +   */
  +  void reMarkParams(XPathContext xctxt)
  +  {
  +    VariableStack vars = xctxt.getVarStack();
  +    vars.remarkParams();
  +  }
  +
   
     /**
      * Pop the stack of default arguments after we're done with them 
  
  
  
  1.14      +8 -0      
xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java
  
  Index: ElemForEach.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ElemForEach.java  2000/12/19 22:37:05     1.13
  +++ ElemForEach.java  2000/12/21 02:11:23     1.14
  @@ -328,6 +328,13 @@
       vars.pushElemFrame();
       return -1;
     }
  +  
  +  /**
  +   * Re-mark the params as params.
  +   */
  +  void reMarkParams(XPathContext xctxt)
  +  {
  +  }
   
     /**
      * Pop Default parameters from the stack 
  @@ -508,6 +515,7 @@
                   t.execute(transformer, child, mode);
                 }
               }
  +            reMarkParams(xctxt);
             }
             finally
             {
  
  
  

Reply via email to