mmidy       00/11/28 12:13:53

  Modified:    src/org/apache/xalan/xslt XSLTEngineImpl.java
                        XSLTProcessor.java
  Log:
  Add reset(boolean resetParams) method, and make reset() call reset(true).
  In processStylesheet, call reset(false), since I don't think this should
  be resetting externally set parameters at this point.
  (Changes made by Scott Boag on Myriam's machine).
  
  Revision  Changes    Path
  1.84      +16 -3     xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
  
  Index: XSLTEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- XSLTEngineImpl.java       2000/11/28 16:58:53     1.83
  +++ XSLTEngineImpl.java       2000/11/28 20:13:51     1.84
  @@ -416,12 +416,24 @@
     {
       setExecContext(parserLiason);
     }
  +     
  +     /**
  +      * Reset the state of the processor, including the parameters.  
  +      * This needs to be called after a process() call
  +      * is invoked, if the processor is to be used again.
  +      */
  +     public void reset()
  +     {
  +             reset(true);
  +     }
   
     /**
      * Reset the state.  This needs to be called after a process() call
      * is invoked, if the processor is to be used again.
  +   * 
  +   * @param resetParams true if the params should be reset.
      */
  -  public void reset()
  +  public void reset(boolean resetParams)
     {
       m_stylesheetRoot = null;
       m_rootDoc = null;
  @@ -442,7 +454,8 @@
       m_variableStacks = new VariableStack();
       m_stackGuard = new StackGuard();
                m_variableGuard = null;
  -     //m_topLevelParams = new Vector();
  +             if(resetParams)
  +                     m_topLevelParams = new Vector();
       m_parserLiaison.reset();
     }
        
  @@ -759,7 +772,7 @@
       throws SAXException
     {
       if(null != m_stylesheetRoot)
  -      reset();
  +      reset(false); /* false?? ...but close enough, I think. -sb */
   
       String xslIdentifier = ((null == stylesheetSource) ||
                               (null == stylesheetSource.getSystemId()))
  
  
  
  1.15      +11 -1     xml-xalan/src/org/apache/xalan/xslt/XSLTProcessor.java
  
  Index: XSLTProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTProcessor.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XSLTProcessor.java        2000/11/28 16:58:53     1.14
  +++ XSLTProcessor.java        2000/11/28 20:13:51     1.15
  @@ -149,10 +149,20 @@
     public void setOutputStream(java.io.OutputStream os);
   
     /**
  +   * Reset the state of the processor, including the parameters.  
  +      * This needs to be called after a process() call
  +      * is invoked, if the processor is to be used again.
  +   */
  +  public void reset();
  +     
  +  /**
      * Reset the XSLTProcessor state.  Must be used after a process() call
      * if the XSLTProcessor instance is to be used again.
  +   * 
  +   * @param resetParams true if the params should be reset.
      */
  -  public void reset();
  +  public void reset(boolean resetParams);
  +
        
        /**
      * Reset the top-level params.
  
  
  

Reply via email to