*/
public static File transform(Source source) throws TransformerException, IOException {
File xmlFile = null;
PrintStream oldErr = TransformerFacade.redirectTransformationMessages();
try {
TransformerFacade preTransformer = getTransformation();
if (preTransformer != null) {
final String xmlOutputFile = System.getProperty(XML_OUTPUT_FILE);
if (xmlOutputFile == null) {
xmlFile = File.createTempFile("preValid", ".sut");
xmlFile.deleteOnExit();
} else {
xmlFile = new File(xmlOutputFile);
}
Result fileResult = new StreamResult(xmlFile);
log.finer("Performing pre-validation transformation to file " + xmlFile.getAbsolutePath());
try {
preTransformer.transform(source, fileResult);
} catch (TransformerException e) {
String message = TransformerFacade.determineErrorMessage(e);
throw new TransformerException(message, e);
}
}