} else {
writer = new StringWriter();
}
// Use XSLTProcessorFactory to instantiate an XSLTProcessor.
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// Create the 3 objects the XSLTProcessor needs to perform the transformation.
// Fix up the args...
XMLParserLiaison xmlPL = processor.getXMLProcessorLiaison();
URL urlTmp = xmlPL.getURLFromString(foFile, null);
MessageHandler.errorln("xml: " + urlTmp);
XSLTInputSource xmlSource =
new XSLTInputSource (urlTmp.toString());
urlTmp = xmlPL.getURLFromString(xsltFile, null);
MessageHandler.errorln("xslt: " + urlTmp);
XSLTInputSource xslSheet =
new XSLTInputSource (urlTmp.toString());
XSLTResultTarget xmlResult = new XSLTResultTarget (writer);
// Perform the transformation.
processor.process(xmlSource, xslSheet, xmlResult);
if (usefile) {
reader = new FileReader(pdfFile + ".tmp");
} else {
// create a input source containing the xsl:fo file which can be fed to Fop