[xsl] Performance issue XSL:FO

Subject: [xsl] Performance issue XSL:FO
From: "Thomas Yip" <tyip@xxxxxxxxxxx>
Date: Fri, 9 Mar 2007 16:45:48 -0500
Hi,

I'm generating a PDF on the fly from my servlet. I use transformer to
do XSL:FO translation:

1> StringReader xmlStream = new StringReader(xmlWriter.toString());
2> Source src = new StreamSource(xmlStream); 
3> Result res = new SAXResult(fop.getDefaultHandler());
4> transformer.transform(src, res);

However line#4 seems to be taking a lot of time to execute (around 40
seconds).

When I run it using the FOP command line (with the same XML content),
for instance:

>> fop -xml myXml.xml -xsl myXsl.xsl -pdf outPDF.pdf

It takes only about 3 seconds.

- Can anybody tell me why it takes so much longer from my servlet?
- Is there a way to improve the performance when run it from my
servlet?

By the way, I use FOP version 0.93.


Thanks for your help.
Thomas

Current Thread