Index: XSLTProcess.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v
retrieving revision 1.8
diff -b -r1.8 XSLTProcess.java
100a101,106
>     private Vector params = new Vector();
> 
>     private File inFile = null;
> 
>     private File outFile = null;
> 
111a118
>         long styleSheetLastModified = 0;
116,125d122
< 	if (baseDir == null)
< 	    baseDir = project.resolveFile(".");
<         //-- make sure Source directory exists...
< 	if (destDir == null ) {
< 	    String msg = "destdir attributes must be set!";
< 	    throw new BuildException(msg);
< 	}
< 	scanner = getDirectoryScanner(baseDir);
< 	log("Transforming into "+destDir, Project.MSG_INFO);
< 
142c139,141
<         long styleSheetLastModified = 0;
---
> 	if (baseDir == null)
> 	    baseDir = project.resolveFile(".");
> 
149a149,152
>                 for(Enumeration e = params.elements();e.hasMoreElements();){
>                     Param p = (Param)e.nextElement();
>                     liaison.addParam( p.getName(), p.getExpression() );
>                 }
155a159,173
>         // if we have an in file and out then process them
>         if(inFile!=null&&outFile!=null){
>             process( inFile, outFile, styleSheetLastModified );
>             return;
>         }
> 
>         //-- make sure Source directory exists...
> 	if (destDir == null ) {
> 	    String msg = "destdir attributes must be set!";
> 	    throw new BuildException(msg);
> 	}
> 
> 	scanner = getDirectoryScanner(baseDir);
> 	log("Transforming into "+destDir, Project.MSG_INFO);
> 
216a235,248
>     /**
>      * Sets an out file
>      */
>     public void setOut(File outFile){
>         this.outFile = outFile;
>     }
> 
>     /**
>      * Sets an input xml file to be styled
>      */
>     public void setIn(File inFile){
>         this.inFile = inFile;
>     }
> 
299a332,333
>             int dotPos = xmlFile.lastIndexOf('.');
>             if(dotPos>0){
300a335,337
>             }else{
> 	        outFile = new File(destDir,xmlFile+fileExt);
>             }
304,305c341,342
< 		//-- command line status
< 		log("Processing " + xmlFile + " to " + outFile, Project.MSG_VERBOSE);
---
> 
> 	        log("Transforming into "+destDir);
314c351
< 	    outFile.delete();
---
> 	    if(outFile!=null)outFile.delete();
319a357,374
>     private void process(File inFile, File outFile, long styleSheetLastModified) throws BuildException {
>         try{
>             log("In file "+inFile+" time: " + inFile.lastModified() , Project.MSG_DEBUG);
>             log("Out file "+outFile+" time: " + outFile.lastModified() , Project.MSG_DEBUG);
>             log("Style file "+xslFile+" time: " + styleSheetLastModified , Project.MSG_DEBUG);
>             if (inFile.lastModified() > outFile.lastModified() ||
>                 styleSheetLastModified > outFile.lastModified()) {
>                 ensureDirectoryFor( outFile );
> 		log("Processing " + inFile + " to " + outFile, Project.MSG_INFO);
>                 liaison.transform(inFile.toString(), outFile.toString());
>             }
>         }catch (Exception ex) {
> 	    log("Failed to process " + inFile, Project.MSG_INFO);
> 	    if(outFile!=null)outFile.delete();
>             throw new BuildException(ex);
>         }
>     }
> 
328a384,408
> 
>     public Param createParam(){
>         Param p = new Param();
>         params.addElement(p);
>         return p;
>     }
> 
>     public class Param{
>         private String name=null;
>         private String expression=null;
>         public void setName(String name){
>             this.name = name;
>         }
>         public void setExpression(String expression){
>             this.expression = expression;
>         }
>         public String getName() throws BuildException{
>             if(name==null)throw new BuildException("Name attribute is missing.");
>             return name;
>         }
>         public String getExpression() throws BuildException{
>             if(expression==null)throw new BuildException("Expression attribute is missing.");
>             return expression;
>         }
>     }
