  | |  | Error when using Templates with XSLTC | Error when using Templates with XSLTC 2003-09-24 - By RKoenig@(protected)
Hi,
I am getting the following error being logged to System.err when trying to transform an XML Document using XSLTC ("org.apache.xalan.xsltc.trax.TransformerFactoryImpl").
mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit ...
The error message is getting output repeatedly (50 - 100 times). It appears that the transformation does occurr correctly. The problem is occurring when the Template is being used repeatedly (at least 20 times). The following code snippet produces the problem.
//Code snippet to execute timing tests using XSLTC. long count = 30; Source xslSource = new StreamSource(new CharArrayReader(xslDocument)); TransformerFactory factory = TransformerFactory.newInstance(); Templates template = factory.newTemplates(xslSource); Transformer transformer = null; ByteArrayOutputStream transformedOutput = null; Document document = XMLCompareUtility.parse(xmlFile); for (int i=0; i < count; i++) { transformedOutput = new ByteArrayOutputStream(65536); transformer = template.newTransformer(); transformer.transform(new DOMSource(document), new StreamResult (transformedOutput)); }
I am using version 2.5.1 of Xalan J. The input document is about 140KB. When I reduce the input document size, the number of errors reduces, but doesn't go away entirely. The problem doesn't occur if I use the following code to assign the transformer object being used:
transformer = factor.newTransformer();
I am wanting to use Template so that I can share the compiled XSL stylesheet between multiple threads in my application.
The same XML document and XSL stylesheet (with the code snippet above) work fine using Template when using the interpreted version of Xalan ("org.apache.xalan.processor.TransformerFactoryImpl").
I would appreciate any feedback that can be offered.
Chris
<br><font size=2 face="Courier New">Hi,</font> <br> <br><font size=2 face="Courier New">I am getting the following error being logged to System.err when trying to transform an XML Document using XSLTC ( "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"). </font> <br> <br><font size=2 face="Courier New">mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit</font> <br><font size=2 face="Courier New">mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit</font> <br><font size=2 face="Courier New">mmiVerifyTpAndGetWorkSize: stack_height=2 should be zero; exit</font> <br><font size=2 face="Courier New">...</font> <br> <br><font size=2 face="Courier New">The error message is getting output repeatedly (50 - 100 times). It appears that the transformation does occurr correctly. The problem is occurring when the Template is being used repeatedly (at least 20 times). The following code snippet produces the problem.</font> <br> <br><font size=2 face="Courier New"> //Code snippet to execute timing tests using XSLTC.</font> <br><font size=2 face="Courier New"> long count = 30 ;</font> <br><font size=2 face="Courier New"> Source xslSource = new StreamSource(new CharArrayReader(xslDocument));</font> <br><font size=2 face="Courier New"> TransformerFactory factory = TransformerFactory.newInstance();</font> <br><font size=2 face="Courier New"> Templates template = factory.newTemplates(xslSource);</font> <br><font size=2 face="Courier New"> Transformer transformer = null;</font> <br><font size=2 face="Courier New"> ByteArrayOutputStream transformedOutput = null;</font> <br><font size=2 face="Courier New"> Document document = XMLCompareUtility.parse(xmlFile);</font> <br><font size=2 face="Courier New"> for (int i=0; i < count; i++)</font> <br><font size=2 face="Courier New"> {</font> <br><font size=2 face="Courier New"> transformedOutput = new ByteArrayOutputStream(65536);</font> <br><font size=2 face="Courier New"> transformer = template.newTransformer();</font> <br><font size=2 face="Courier New"> transformer.transform(new DOMSource(document), new StreamResult (transformedOutput));</font> <br><font size=2 face="Courier New"> }</font> <br> <br><font size=2 face="Courier New">I am using version 2.5.1 of Xalan J.   ;The input document is about 140KB. When I reduce the input document size, the number of errors reduces, but doesn't go away entirely. The problem doesn't occur if I use the following code to assign the transformer object being used: </font> <br> <br><font size=2 face="Courier New"> transformer = factor.newTransformer();</font> <br> <br><font size=2 face="Courier New">I am wanting to use Template so that I can share the compiled XSL stylesheet between multiple threads in my application.< /font> <br> <br><font size=2 face="Courier New">The same XML document and XSL stylesheet (with the code snippet above) work fine using Template when using the interpreted version of Xalan ("org.apache.xalan.processor .TransformerFactoryImpl").</font> <br> <br><font size=2 face="Courier New">I would appreciate any feedback that can be offered.</font> <br> <br><font size=2 face="Courier New">Chris</font>
===============================================
This e-mail is intended only for its addressee and may contain information that is privileged, confidential, or otherwise protected from disclosure. If you have received this communication in error, please notify us immediately by e-mail: postmaster@(protected), and delete the original message.
===============================================
|
|
 |