Browse Source

- back to File-based algorithm

- cpu enhancement

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@426494 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 19 years ago
parent
commit
9d42b05f17
1 changed files with 6 additions and 15 deletions
  1. +6
    -15
      src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java

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

@@ -1036,24 +1036,15 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
XSLTLiaison liaison,
File inFile
) throws Exception {
String fileName = FileUtils.getRelativePath(baseDir, inFile);
String name;
String dir;
int lastDirSep = fileName.lastIndexOf("/");
if (lastDirSep > -1) {
name = fileName.substring(lastDirSep + 1);
dir = fileName.substring(0, lastDirSep);
} else {
name = fileName;
dir = "."; // so a dir+"/"+name would not result in an absolute path
}
if (fileNameParameter != null) {
liaison.addParam(fileNameParameter, name);
liaison.addParam(fileNameParameter, inFile.getName());
}
if (fileDirParameter != null) {
liaison.addParam(fileDirParameter, dir);
String fileName = FileUtils.getRelativePath(baseDir, inFile);
File file = new File(fileName);
// Give always a slash as file separator, so the stylesheet could be sure about that
// Use '.' so a dir+"/"+name would not result in an absolute path
liaison.addParam(fileDirParameter, (file.getParent()!=null) ? file.getParent().replace('\\','/') : "." );
}
}



Loading…
Cancel
Save