You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/11/15 12:59:31 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs XSLTProcess.java

bodewig     2002/11/15 03:59:31

  Modified:    .        WHATSNEW
               docs/manual/CoreTasks style.html
               src/main/org/apache/tools/ant/taskdefs XSLTProcess.java
  Log:
  Throw in a reuseloadedstylesheet attribute for <style> (feel free to
  come up with a better name).  This provides a workaround for a bug in
  Xalan-J - the version that gets distributed with JDK 1.4.1.
  
  PR: 13859
  
  based on a patch submitted by:	Jens Elkner <elkner at linofee.org>
  
  Revision  Changes    Path
  1.319     +3 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.318
  retrieving revision 1.319
  diff -u -r1.318 -r1.319
  --- WHATSNEW	14 Nov 2002 07:48:24 -0000	1.318
  +++ WHATSNEW	15 Nov 2002 11:59:30 -0000	1.319
  @@ -106,6 +106,9 @@
   
   * Shipped XML parser is now Xerces 2.2.1
   
  +* <style> has a new attribute reuseloadedstylesheet to work around a
  +  bug in widespread Xalan versions.
  +
   Changes from Ant 1.5.1Beta1 to 1.5.1
   ====================================
   
  
  
  
  1.24      +8 -0      jakarta-ant/docs/manual/CoreTasks/style.html
  
  Index: style.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/style.html,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- style.html	12 Jul 2002 21:25:29 -0000	1.23
  +++ style.html	15 Nov 2002 11:59:31 -0000	1.24
  @@ -151,6 +151,14 @@
         directories.  Default is <code>true</code></td>
       <td valign="top" align="center">No</td>
     </tr>
  +  <tr>
  +    <td valign="top">reuseloadedstylesheet</td>
  +    <td valign="top">Reuse the same transformer when transforming
  +    multiple files.  If you set this to false, performance will
  +    suffer, but you may work around a bug in certain Xalan-J versions.
  +    Default is <code>true</code>.  <em>Since Ant 1.6</em>.</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
   </table>
   <h3>Parameters specified as nested elements</h3>
   <h4>classpath</h4>
  
  
  
  1.54      +21 -2     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  
  Index: XSLTProcess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- XSLTProcess.java	5 Nov 2002 16:33:28 -0000	1.53
  +++ XSLTProcess.java	15 Nov 2002 11:59:31 -0000	1.54
  @@ -158,6 +158,12 @@
       private Factory factory = null;
   
       /**
  +     * whether to reuse Transformer if transforming multiple files.
  +     * @since 1.6
  +     */
  +    private boolean reuseLoadedStylesheet = true;
  +
  +    /**
        * Creates a new XSLTProcess Task.
        */
       public XSLTProcess() {
  @@ -176,6 +182,19 @@
       }
   
       /**
  +     * Whether to reuse the transformer instance when transforming
  +     * multiple files.
  +     *
  +     * <p>Setting this to false may get around a bug in certain
  +     * Xalan-J version, default is true.</p>
  +     *
  +     * @since Ant 1.6
  +     */
  +    public void setReuseLoadedStylesheet(boolean b) {
  +        reuseLoadedStylesheet = b;
  +    }
  +
  +    /**
        * Executes the task.
        *
        * @exception BuildException if there is an execution problem.
  @@ -713,7 +732,7 @@
        * @exception BuildException if the stylesheet cannot be loaded.
        */
       protected void configureLiaison(File stylesheet) throws BuildException {
  -        if (stylesheetLoaded) {
  +        if (stylesheetLoaded && reuseLoadedStylesheet) {
               return;
           }
           stylesheetLoaded = true;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>