"Shaikh, Mehmood" <[EMAIL PROTECTED]> wrote:
> How do I call FOP passing XML as a String (instead of file) and XSL as file?

Instantiate a transformer yourself and feed it a StringReader. Let
it generate a SAXResult and plumb it to a FOP Driver.
  StreamSource xslSource=new StreamSource(new File("foo.xsl"));
  StreamSource xmlSource=new StreamSource(new StringReader("<?xml..."));
  Transformer transformer=TransformerFactory.newInstance()
  Driver driver=new Driver();
  transformer.transform(xmlSource, new SAXResult(driver.getContentHandler()));
Complete further as necessary (driver parameters, logger etc.)


Reply via email to