diff --git a/manual/Tasks/junitreport.html b/manual/Tasks/junitreport.html index cdf171e2e..365afe643 100644 --- a/manual/Tasks/junitreport.html +++ b/manual/Tasks/junitreport.html @@ -167,6 +167,15 @@ These tags can pass XSL parameters to the stylesheet. +

classpath

+

Since Ant 1.10. +Like for the XSLT task, +a nested <classpath> will be used to load the processor.

+ +

factory

+

Since Ant 1.10. +Like for the XSLT task, +a nested <factory> can be used to specify factory settings.

Example of report

diff --git a/manual/Tasks/style.html b/manual/Tasks/style.html index 6e2a2a523..f02b98eb4 100644 --- a/manual/Tasks/style.html +++ b/manual/Tasks/style.html @@ -269,7 +269,7 @@ collection should be applied to. Use a nested mapper and the task's destdir attribute to specify the output files.

-

classpath

+

classpath

The classpath to load the processor from can be specified via a nested <classpath>, as well - that is, a path-like structure.

@@ -372,7 +372,7 @@ XSLT specifications. -

factory ('trax' processors only)

+

factory ('trax' processors only)

Used to specify factory settings.

Parameters

diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java index 46c440674..c22bbc881 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java @@ -37,6 +37,7 @@ import org.apache.tools.ant.taskdefs.Delete; import org.apache.tools.ant.taskdefs.TempFile; import org.apache.tools.ant.taskdefs.XSLTProcess; import org.apache.tools.ant.types.EnumeratedAttribute; +import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.resources.FileResource; import org.apache.tools.ant.types.resources.URLResource; @@ -90,11 +91,11 @@ public class AggregateTransformer { protected File toDir; /** - * The params that will be sent to the XSL transformation + * The internal XSLT task used to perform the transformation. * - * @since Ant 1.7 + * @since Ant 1.10 */ - private List params; + private XSLTProcess xsltTask; /** * Instance of a utility class to use for file operations. @@ -129,7 +130,8 @@ public class AggregateTransformer { */ public AggregateTransformer(Task task) { this.task = task; - params = new Vector(); + xsltTask = new XSLTProcess(); + xsltTask.bindToOwner(task); } /** @@ -209,9 +211,27 @@ public class AggregateTransformer { * @since Ant 1.7 */ public XSLTProcess.Param createParam() { - XSLTProcess.Param p = new XSLTProcess.Param(); - params.add(p); - return p; + return xsltTask.createParam(); + } + + /** + * Creates a classpath to be used for the internal XSLT task. + * + * @return the classpath to be configured + * @since Ant 1.10 + */ + public Path createClasspath() { + return xsltTask.createClasspath(); + } + + /** + * Creates a factory configuration to be used for the internal XSLT task. + * + * @return the factory description to be configured + * @since Ant 1.10 + */ + public XSLTProcess.Factory createFactory() { + return xsltTask.createFactory(); } /** @@ -225,9 +245,6 @@ public class AggregateTransformer { TempFile tempFileTask = new TempFile(); tempFileTask.bindToOwner(task); - XSLTProcess xsltTask = new XSLTProcess(); - xsltTask.bindToOwner(task); - xsltTask.setXslResource(getStylesheet()); // acrobatic cast. @@ -245,13 +262,6 @@ public class AggregateTransformer { outputFile = new File(toDir, "junit-noframes.html"); } xsltTask.setOut(outputFile); - for (Iterator i = params.iterator(); i.hasNext();) { - XSLTProcess.Param param = (XSLTProcess.Param) i.next(); - XSLTProcess.Param newParam = xsltTask.createParam(); - newParam.setProject(task.getProject()); - newParam.setName(param.getName()); - newParam.setExpression(param.getExpression()); - } XSLTProcess.Param paramx = xsltTask.createParam(); paramx.setProject(task.getProject()); paramx.setName("output.dir");