Rhett Aultman schrieb:
> 
>
> 
> This may sound like a bizarre question, but you are transforming the XHTML to a FO 
>document before you attemt to render it, right?  To the best of my knowledge, you 
>must perform your own transforms and provide FOP with valid FO.  Are you using a 
>technique like the recommended one for going from an XML document to FO like this one 
>listed on the FOP website:
> 
> Driver driver = new Driver();
>   driver.setRenderer(Driver.RENDER_PDF);
>   InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
>   XMLReader parser = inputHandler.getParser();
>   driver.setOutputStream(new FileOutputStream(outFile));
>   driver.render(parser, inputHandler.getInputSource());
> 

That's what I'm doing in my Filter. I wrote the code just like in the
embedding examples in the
FOP documentation; after some weird exceptions, I found out FOP used an
Oracle parser from the class path, so I explicitly had to set it up to
use the SAX-Parser. The complete snippet looks like this:

Driver driver = new Driver() ;
driver.setLogger(fopLog) ;
driver.setRenderer(Driver.RENDER_PDF) ;
driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
driver.setOutputStream(out) ;
XSLTInputHandler xsltInput = new XSLTInputHandler (inputFile,
stylesheet) ;           
XMLReader parser = (XMLReader)
Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();
driver.render(parser, xsltInput.getInputSource()) ;


Can't see any difference to your example... except that it doesn't work,
of course.
Thanks,
Hans

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

Reply via email to