Browse Source

fail early if stylesheet doesn't exist. PR 34525.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@720746 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
bf5fd79380
3 changed files with 16 additions and 0 deletions
  1. +3
    -0
      WHATSNEW
  2. +6
    -0
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  3. +7
    -0
      src/tests/antunit/taskdefs/xslt-test.xml

+ 3
- 0
WHATSNEW View File

@@ -548,6 +548,9 @@ Other changes:
-docfilessubdirs and -excludedocfilessubdir command line arguments. -docfilessubdirs and -excludedocfilessubdir command line arguments.
Bugzilla Report 34455. Bugzilla Report 34455.


* <xslt> now fails early if a specified stylesheet doesn't exist.
Bugzilla Report 34525.

Changes from Ant 1.7.0 TO Ant 1.7.1 Changes from Ant 1.7.0 TO Ant 1.7.1
============================================= =============================================




+ 6
- 0
src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java View File

@@ -322,6 +322,12 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
} else { } else {
styleResource = xslResource; styleResource = xslResource;
} }

if (!styleResource.isExists()) {
throw new BuildException("stylesheet " + styleResource
+ " doesn't exist.");
}

// if we have an in file and out then process them // if we have an in file and out then process them
if (inFile != null && outFile != null) { if (inFile != null && outFile != null) {
process(inFile, outFile, styleResource); process(inFile, outFile, styleResource);


+ 7
- 0
src/tests/antunit/taskdefs/xslt-test.xml View File

@@ -66,4 +66,11 @@ undefined='<xsl:value-of select="$undefined"/>'
value="set='somevalue'"/> value="set='somevalue'"/>
</target> </target>


<target name="testStyleDoesntExist" depends="setUp">
<au:expectfailure expectedmessage="i-m-not-there.xslt doesn't exist.">
<xslt in="${legacy.dir}/data.xml"
out="${output}/out.xml"
style="i-m-not-there.xslt"/>
</au:expectfailure>
</target>
</project> </project>

Loading…
Cancel
Save