Hi, Bob,
you can do it but FOP isn't exactly optimized for your problem.
You'll have to do the following steps:
1. Create an XSL transformer factory:
  TransformerFactory tfactory  = TransformerFactory.newInstance();
2. Create a transformer with your XSL string source:
  Transformer transformer = tfactory.newTransformer(
    new StreamSource(new StringReader(xslString)));
3. Create a FOP driver, set any parameters you want.
    Driver driver=new Driver();
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setOutputStream(outStream);
4. Invoke the transform() method of the transformer,
   supplying the XML string as a source and the FOP driver
   as the result:
    transformer.transform(new StreamSource(
       new StringReader(xmlString)),
       new SAXResult(driver.getContentHandler));
Look at java.xml.transform (from the Xalan or j2ee distribution)
for details about creating and invoking Transformers and dealing
with ErrorListener stuff.
BTW you can save a great deal of memory and processor capacity
if you can get your program parts to communicate via SAX events
instead of strings.
You'll need a FOP 0.20.2 distribution for doing the above.

All untested, as i'm using something more convoluted due to
FOP 0.20.1 legacy. HTH anyway.


Joerg Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to