if (sysProperties.size() > 0) {
sysProperties.setSystem();
}
Resource styleResource;
if (baseDir == null) {
baseDir = getProject().getBaseDir();
}
liaison = getLiaison();
// check if liaison wants to log errors using us as logger
if (liaison instanceof XSLTLoggerAware) {
((XSLTLoggerAware) liaison).setLogger(this);
}
log("Using " + liaison.getClass().toString(), Project.MSG_VERBOSE);
if (xslFile != null) {
// If we enter here, it means that the stylesheet is supplied
// via style attribute
File stylesheet = getProject().resolveFile(xslFile);
if (!stylesheet.exists()) {
File alternative = FILE_UTILS.resolveFile(baseDir, xslFile);
/*
* shouldn't throw out deprecation warnings before we know,
* the wrong version has been used.
*/
if (alternative.exists()) {
log("DEPRECATED - the 'style' attribute should be "
+ "relative to the project's");
log(" basedir, not the tasks's basedir.");
stylesheet = alternative;
}
}
FileResource fr = new FileResource();
fr.setProject(getProject());
fr.setFile(stylesheet);
styleResource = fr;
} else {
styleResource = xslResource;
}
if (!styleResource.isExists()) {
handleError("stylesheet " + styleResource + " doesn't exist.");
return;
}
// if we have an in file and out then process them