diff --git a/docs/manual/CoreTasks/style.html b/docs/manual/CoreTasks/style.html index a9212cf1f..6f3ae76e0 100644 --- a/docs/manual/CoreTasks/style.html +++ b/docs/manual/CoreTasks/style.html @@ -53,7 +53,10 @@ inclusion/exclusion of files works, and how to write patterns.

style name of the stylesheet to use - given either relative - to the basedir attribute or as an absolute path. + to the project's basedir or as an absolute path + DEPRECATED - can be specified as a path relative + to the basedir attribute of this task as well. + Yes diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java index 813a96520..5180bdfde 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java +++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java @@ -153,7 +153,14 @@ public class XSLTProcess extends MatchingTask { long styleSheetLastModified = 0; if (xslFile != null) { try { - File file = project.resolveFile(xslFile, baseDir); + File file = project.resolveFile(xslFile, project.getBaseDir()); + + if (!file.exists()) { + log("DEPRECATED - the style attribute should be relative to the project\'s"); + log(" basedir, not the tasks\'s basedir."); + file = project.resolveFile(xslFile, baseDir); + } + // Create a new XSL processor with the specified stylesheet styleSheetLastModified = file.lastModified(); log( "Loading stylesheet " + file, Project.MSG_INFO);