--- jakarta-ant-1.5.1/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Wed Oct 2 17:09:03 2002 +++ ant-1.5.1/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Thu Oct 24 06:25:30 2002 @@ -153,6 +153,13 @@ private boolean performDirectoryScan = true; /** + * Whether to reuse templates once loaded. + * + * @since Ant 1.5.2 + */ + private boolean optimized = true; + + /** * Creates a new XSLTProcess Task. */ public XSLTProcess() { @@ -701,13 +708,35 @@ } /** + * Whether to reuse stylesheets once loaded. Default: true + * + * @param value true|false + */ + public void setOptimized(String value) { + if ("true".equals(value)) { + optimized = true; + } else if ("false".equals(value)) { + optimized = false; + } else { + log("Unknown value \"" + value + "\" ignored.", Project.MSG_WARN); + } + } + + /** + * @return whether a stylesheet is reused once loaded. + */ + public String getOptimized() { + return optimized ? "true" : "false"; + } + + /** * Loads the stylesheet and set xsl:param parameters. * * @param stylesheet the file form which to load the stylesheet. * @exception BuildException if the stylesheet cannot be loaded. */ protected void configureLiaison(File stylesheet) throws BuildException { - if (stylesheetLoaded) { + if (stylesheetLoaded && optimized) { return; } stylesheetLoaded = true;