"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()
    .newTransformer(xslSource);
  Driver driver=new Driver();
  driver.setOutputStream(...);
  driver.setRenderer(...RENDER_PDF);
  transformer.transform(xmlSource, new SAXResult(driver.getContentHandler()));
Complete further as necessary (driver parameters, logger etc.)

J.Pietschmann

Reply via email to