Subjects
Home
Xalan extension functions
Fomatting question serializing DOM with pretty print
xalan with pull parser
Cannot find the declaration
Apache Xalan drop support to run on JRE 1 1 x
Why does Doctype change processing of a document
Node set to XML string via Java extensions in Xalan J: possible?
Templates/Transformers + thread safety???
Problem evaluating xpath with muliple prefix with different namespace
remove an arbitrary attribute from xsl output
Xalan3 XSLT 2 0 XPath 2 0 support?
Problem using compiled translets with Xalan !!
Xalan and jstl 1 1 problem with transform tag
NullPointer in DOM2DTM getLocalName
URIResolvers base parameter with xsltc and cascaded imports
Performance problem for Xalan J on intel dual core
Standard libraries in JAXP?
Serializing a DOM tree to XML file, customize entities replacement
Library Conflict Involving BCEL Library
A question on how users are using <xsl:message >
Kevin Cormier as a new Apache Xalan J committer
Struggling to iterate over tokenized string
Xalan count() trouble
Problem with recursive xpath
Error when switching to java 1 5
document( ' ')
Problem with Xalan2 7 0 transformation
cr/lf options
entity encoded XML
can xalan transform 2 xml using one xslt?
Xalan J JIRA defect review Monday October 16, 2006 from 2:00 to 3:30 pm ED
xsl transform with cdata section elements
xslt parameters not expanded
Weird behavior of XPath evaluate()
How to avoid <xsl:message > instruction prints stylesheet file informations ?
Cannot find SimpleTransform subdirectory after installing Xalan J
recover from document not found exceptions
jdk1 5 and Xalan jar differences?
Performance Issue
Error/Bug adding floating point numbers
XPathAPI: eval exp using nodes with default namespace
modifying xalan to output invalid XML
NullPointerException
mege two separate xml nodes into one
Is this a XALAN document identification bug?
is StylesheetRoot really java io Serializable ?
transform() fails for DOMSource but succeeds for StreamSource
Thoughts on Transformer parameter passing
HELP, Xalan and jstl 1 1 problem with transformer
Problem with XPath namespace axis?
string utils:replace deleting search string if replacement string is an HTML
help with enumeration values pls
xalan 2 5 1 vs 2 7 performance question
How to insert/update in XML document
HTML Serialization and Handling of Ampersands in HREF Attributes
XHTML link tag stripping
SystemId Unknown; Line #24; Column #49; java lang NullPointerException
xpath text() help
Apostrophe problem with xalan 2 7 0
How to set variables in XML document?
Links
Home
Oracle database error code ...
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
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 (
&quot;org.apache.xalan.xsltc.trax.TransformerFactoryImpl&quot;). &nbsp;</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). &nbsp;It appears that the transformation does
occurr correctly. &nbsp;The problem is occurring when the Template is being
used repeatedly (at least 20 times). &nbsp;The following code snippet produces
the problem.</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; //Code snippet
to execute timing tests using XSLTC.</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; long count = 30
;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; Source
xslSource = new StreamSource(new CharArrayReader(xslDocument));</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;
TransformerFactory factory = TransformerFactory.newInstance();</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; Templates
template = factory.newTemplates(xslSource);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; Transformer
transformer = null;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;
ByteArrayOutputStream transformedOutput = null;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; Document
document = XMLCompareUtility.parse(xmlFile);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; for (int i=0; i
&lt; count; i++)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; transformedOutput = new ByteArrayOutputStream(65536);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; transformer = template.newTransformer();</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; transformer.transform(new DOMSource(document), new StreamResult
(transformedOutput));</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br>
<br><font size=2 face="Courier New">I am using version 2.5.1 of Xalan J. &nbsp
;The input document is about 140KB. &nbsp;When I reduce the input document size,
the number of errors reduces, but doesn't go away entirely. &nbsp;The problem
doesn't occur if I use the following code to assign the transformer object
being used:
&nbsp;</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; 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 (&quot;org.apache.xalan.processor
.TransformerFactoryImpl&quot;).</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.

===============================================