AH Formatter / XSL Formatter
Q&A



Programming

Java Programming

Top
Basic, General
About AH Formatter
About XSL Formatter
Operation
Programming
XSLT/XSL-FO/SVG/MathML Conformance
XSLT/XSL-FO/MathML Technics
Index
Q.  I used the Java interface of XSLFormatter with JavaVM+Tomcat. And, I see the error happen. Why? [No.2008022001]
A. 

It is as follows in sample5.java of the XSL Formatter Java sample program.

TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer(new StreamSource(fisXsl));
transformer.transform(new StreamSource(fisXml), new StreamResult(bosFo));
bisFo = new ByteArrayInputStream(bosFo.toByteArray());				
axfo.render(bisFo, fosPdf, "@PDF");
			

The toByteArray() method progresses the FO data on the memory by the byte array. Therefore, the unexpected error might happen due to memory shortage if huge FO data is formatted. This problem might be solved when changing to the method of saving the temporary file FO instead of the toByteArray() method.

Sample5.java attached to a version that is newer than XSL Formatter V4.2 MR5 is changed to this way.


Copyright © 1999-2011 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.