Usually what this error  means is that you have a single xsl:template 
which is excessively complex. There's a Java limitation on how large a 
single method may be, and a template starts out as a single method. 
Xalan's code generation attempts to modularize excessively large 
functions, but it looks like this is a case where it couldn't do so.

You can work around that at the stylesheet level by moving some of the 
function out into a "subroutine" template invoked with 
xsl:call-template... or by replacing xsl:for-each loops with 
xsl:apply-template and additional templates (using a mode, if necessary, 
to distinguish this case).



______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)



From:
"Sanitha Alam (JIRA)" <xalan-dev@xml.apache.org>
To:
xalan-dev@xml.apache.org
Date:
08/16/2010 04:21 AM
Subject:
[jira] Created: (XALANC-704) Branch target offset too large for short; 
Could not compile stylesheet



Branch target offset too large for short; Could not compile stylesheet
----------------------------------------------------------------------

                 Key: XALANC-704
                 URL: https://issues.apache.org/jira/browse/XALANC-704
             Project: XalanC
          Issue Type: Bug
            Reporter: Sanitha Alam


com.sun.org.apache.bcel.internal.generic.ClassGenException: Branch target 
offset too large for short
        at 
com.sun.org.apache.bcel.internal.generic.BranchInstruction.dump(BranchInstruction.java:99)
        at 
com.sun.org.apache.bcel.internal.generic.InstructionList.getByteCode(InstructionList.java:980)
        at 
com.sun.org.apache.bcel.internal.generic.MethodGen.getMethod(MethodGen.java:616)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileNamedTemplate(Mode.java:556)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileTemplates(Mode.java:566)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:818)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:615)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Stylesheet.java:730)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:354)
        at 
com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:429)
        at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)
        at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:617)
        at xmleditor.XMLTransform.main(XMLTransform.java:40)
ERROR:  'Branch target offset too large for short'
FATAL ERROR:  'Could not compile stylesheet'
Exception in thread "main" 
javax.xml.transform.TransformerConfigurationException: Could not compile 
stylesheet
        at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:828)
        at 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:617)
        at xmleditor.XMLTransform.main(XMLTransform.java:40)
Java Result: 1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org


Reply via email to