DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16311>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16311 Calling apply-imports in a template matching text() gets variable stack out-of-sync Summary: Calling apply-imports in a template matching text() gets variable stack out-of-sync Product: XalanJ2 Version: 2.4 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: org.apache.xalan.transformer AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I have one template which imports another one. In the first template, I have a rule matching text(), which does some stuff and calls apply-imports. There is no other text() rule in the imported stylesheets so the default rule is used. This results in an extra "unlink()" call being made to the variable stack. In my program, at the end of the stylesheet I get an ArrayIndexOutOfBoundsException when the last "reset()" call is done on the variable stack. I think the bug is in the method applyTemplateToNode() in TransformerImpl.java, since there is an unlink in a finally clause. When apply-imports is called and the rule is the default text fule, no link is done, but the finally clause is executed anyway. I made an ugly patch for this and it made the bug go away. Note: despite the name of this method, it seems to be called only for the root node and any apply-imports rules.
