[
http://issues.apache.org/jira/browse/XALANJ-2160?page=comments#action_12314612
]
Henry Zongaro commented on XALANJ-2160:
---------------------------------------
Hmmm. I thought I had a simple fix for this problem, but the output that
results with my fix is incorrect, so there must be a second problem. In the
meanwhile, you could try changing the last template in your example stylesheet
to the following as a work-around. That is, change /val[1] and /val[2] to
val[1] and val[2], respectively - the leading slash is redundant here.
<xsl:template match="/" mode="params">
<xsl:copy-of select="."/>
<tr>
<td>
<xsl:value-of select="val[1]"/>
</td>
<td>
<xsl:value-of select="val[2]"/>
</td>
</tr>
</xsl:template>
> XSLTC fails with absolute path expression that has one step and a numeric
> predicate
> -----------------------------------------------------------------------------------
>
> Key: XALANJ-2160
> URL: http://issues.apache.org/jira/browse/XALANJ-2160
> Project: XalanJ2
> Type: Bug
> Components: XSLTC
> Versions: 2.6
> Environment: Linux,
> java version "1.5.0_03"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
> Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
> >>>>>>> Xalan Version Xalan Java 2.6.0, <<<<<<<
> Reporter: Ignat Zapolsky
> Attachments: j2160.xml, j2160.xsl, sample.xml, sample.xsl
>
> Conversion is run using following command line:
> java -Duser.language=en -Duser.country=us -cp
> xalan.jar:xercesImpl.jar:xmlParserAPIs.jar org.apache.xalan.xslt.Process -V
> -XSLTC -in sample.xml -xsl sample.xsl -out result.html
> Exception :
> org.apache.bcel.generic.ClassGenException: ICONST can be used only for value
> between -1 and 5: 15
> at org.apache.bcel.generic.ICONST.<init>(ICONST.java:81)
> at
> org.apache.xalan.xsltc.compiler.Step.translatePredicates(Step.java:386)
> at org.apache.xalan.xsltc.compiler.Step.translate(Step.java:224)
> at
> org.apache.xalan.xsltc.compiler.AbsoluteLocationPath.translate(AbsoluteLocationPath.java:91)
> at
> org.apache.xalan.xsltc.compiler.CastExpr.translate(CastExpr.java:231)
> at org.apache.xalan.xsltc.compiler.ValueOf.translate(ValueOf.java:123)
> at
> org.apache.xalan.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:490)
> at
> org.apache.xalan.xsltc.compiler.LiteralElement.translate(LiteralElement.java:412)
> at
> org.apache.xalan.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:490)
> at
> org.apache.xalan.xsltc.compiler.LiteralElement.translate(LiteralElement.java:412)
> at
> org.apache.xalan.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:490)
> at
> org.apache.xalan.xsltc.compiler.Template.translate(Template.java:335)
> at
> org.apache.xalan.xsltc.compiler.TopLevelElement.compile(TopLevelElement.java:56)
> at
> org.apache.xalan.xsltc.compiler.Mode.compileNamedTemplate(Mode.java:572)
> at
> org.apache.xalan.xsltc.compiler.Mode.compileTemplates(Mode.java:589)
> at
> org.apache.xalan.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:841)
> at
> org.apache.xalan.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:584)
> at
> org.apache.xalan.xsltc.compiler.Stylesheet.translate(Stylesheet.java:695)
> at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:335)
> at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:410)
> at
> org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:720)
> at org.apache.xalan.xslt.Process.main(Process.java:721)
> ERROR: 'ICONST can be used only for value between -1 and 5: 15'
> FATAL ERROR: 'Could not compile stylesheet'
> But when -XSLTC option omitted everything goes well. It is not an option for
> us to disable stylesheet compilation.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]