1. You can and should reuse the TransformerFactory.
2. FO is not a stylesheet.  The FO is the input to the transform, where
you were putting the XML not the XSL.  Leave out the XSL part on the FO
one.
 

________________________________

From: Theresa Jayne Forster [mailto:ther...@inbrand.co.uk] 
Sent: Friday, June 03, 2011 10:30 AM
To: fop-users@xmlgraphics.apache.org
Subject: Hair ripping time



Ok I cannot see what is wrong here, 

A test app does this 

 

            Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

            TransformerFactory factory =
TransformerFactory.newInstance();

            Source xslt = new StreamSource(new File("C:/sample.xsl"));

            Transformer transformer = factory.newTransformer(xslt);

 

And works fine, 

The app I am working on does this

 

            Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);

            TransformerFactory factory =
TransformerFactory.newInstance();

            Transformer transformer = factory.newTransformer(new
StreamSource(inputFO));

 

And it immediately jumps out when it hits the newTransformer() line....

In the first it's an xslt, in the second it's a FO file, do I have to do
something different for that?

 

WTF aren't these the same, and why does so much of FOP jump out without
even trying to give debug output? Or is there a way of doing that?

 

 

Kindest regards

 


Theresa Forster

Senior Software Developer



 

Reply via email to