diff --git a/src/etc/testcases/taskdefs/style/build.xml b/src/etc/testcases/taskdefs/style/build.xml
index e767feb14..3d839b77f 100644
--- a/src/etc/testcases/taskdefs/style/build.xml
+++ b/src/etc/testcases/taskdefs/style/build.xml
@@ -109,15 +109,18 @@
-
+
+
-
+
-
+
@@ -125,7 +128,9 @@
-
+
@@ -180,4 +185,4 @@
/>
-
\ No newline at end of file
+
diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
index 02896de98..d93edd440 100644
--- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
+++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
@@ -34,6 +34,7 @@ import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.ResourceCollection;
import org.apache.tools.ant.types.XMLCatalog;
import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.resources.Resources;
import org.apache.tools.ant.types.resources.Union;
import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.FileUtils;
@@ -222,13 +223,25 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
}
/**
- * Adds the XSLT stylesheet as a resource
- * @param xslResource the stylesheet as a
- * {@link org.apache.tools.ant.types.Resource}
+ * Add a nested <style> element.
+ * @param rc the configured Resources object represented as <style>.
* @since Ant 1.7
*/
- public void addConfigured(Resource xslResource) {
- this.xslResource = xslResource;
+ public void addConfiguredStyle(Resources rc) {
+ if (rc.size() != 1) {
+ throw new BuildException("The style element must be specified"
+ + " with exactly one nested resource.");
+ }
+ setXslResource((Resource) rc.iterator().next());
+ }
+
+ /**
+ * API method to set the XSL Resource.
+ * @param xslResource Resource to set as the stylesheet.
+ * @since Ant 1.7
+ */
+ public void setXslResource(Resource xslResource) {
+ this.xslResource = xslResource;
}
/**
@@ -1204,4 +1217,4 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
}
}
-}
\ No newline at end of file
+}
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 13ef98753..92e902e3a 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
@@ -229,7 +229,8 @@ public class AggregateTransformer {
XSLTProcess xsltTask = new XSLTProcess();
xsltTask.bindToOwner(task);
- xsltTask.addConfigured(getStylesheet());
+ xsltTask.setXslResource(getStylesheet());
+
// acrobatic cast.
xsltTask.setIn(((XMLResultAggregator) task).getDestinationFile());
File outputFile = null;