Project

Profile

Help

Bug #4123

closed

ClassCastException running analyze-string after exporting/reloading and generating bytecode

Added by Michael Kay over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT export
Sprint/Milestone:
-
Start date:
2019-01-30
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:

Description

T. Hatanaka reported by direct email:

With the attached files, you can export and run test.xsl on Saxon-EE 9.9.0.2:


   C:\test>java -jar SaxonEE9-9-0-2J\saxon9ee.jar -export:test.sef -nogo -t -xsl:test.xsl
   Saxon-EE 9.9.0.2J from Saxonica
   Java version 1.8.0_181
   Using license serial number V006911
   URIResolver.resolve href="xhtml1-transitional.xsd" base="file:/C:/test/test.xsl"
   Loading schema document file:/C:/test/xhtml1-transitional.xsd
   URIResolver.resolve href="http://www.w3.org/2001/xml.xsd" base="file:/C:/test/xhtml1-transitional.xsd"
   Finished loading schema document file:/C:/test/xhtml1-transitional.xsd
   Stylesheet compilation time: 2.6360504s (2636.0504ms)
   Stylesheet exported to: C:\test\test.sef

   C:\test>java -jar SaxonEE9-9-0-2J\saxon9ee.jar -config:config.xml -s:test.xml -t -xsl:test.sef
   Saxon-EE 9.9.0.2J from Saxonica
   Java version 1.8.0_181
   Using license serial number V006911
   Stylesheet compilation time: 565.9796ms
   Processing file:/C:/test/test.xml
   Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
   Building tree for file:/C:/test/test.xml using class net.sf.saxon.tree.tiny.TinyBuilder
   Tree built in 19.1438ms
   Tree size: 766 nodes, 1760 characters, 0 attributes
   <?xml version="1.0" encoding="UTF-8"?>Lorem Lorem ...Execution time: 156.3841ms
   Memory used: 20,531,616


Doing the exact same commands fails on 9.9.1.1:

   C:\test>java -jar SaxonEE9-9-1-1J\saxon9ee.jar -export:test.sef -nogo -t -xsl:test.xsl
   Saxon-EE 9.9.1.1J from Saxonica
   Java version 1.8.0_181
   Using license serial number V006911
   URIResolver.resolve href="xhtml1-transitional.xsd" base="file:/C:/test/test.xsl"
   Loading schema document file:/C:/test/xhtml1-transitional.xsd
   URIResolver.resolve href="http://www.w3.org/2001/xml.xsd" base="file:/C:/test/xhtml1-transitional.xsd"
   Finished loading schema document file:/C:/test/xhtml1-transitional.xsd
   Stylesheet compilation time: 2.5840584s (2584.0584ms)
   Stylesheet exported to: C:\test\test.sef

   C:\test>java -jar SaxonEE9-9-1-1J\saxon9ee.jar -config:config.xml -s:test.xml -t -xsl:test.sef
   Saxon-EE 9.9.1.1J from Saxonica
   Java version 1.8.0_181
   Using license serial number V006911
   Stylesheet compilation time: 574.3212ms
   Processing file:/C:/test/test.xml
   Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
   Building tree for file:/C:/test/test.xml using class net.sf.saxon.tree.tiny.TinyBuilder
   Tree built in 17.9948ms
   Tree size: 766 nodes, 1760 characters, 0 attributes
   java.lang.ClassCastException: net.sf.saxon.value.StringValue cannot be cast to net.sf.saxon.om.NodeInfo
           at EE_EE_NonMatchingExpr_72005028997.iterate(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.iterate(CompiledExpression.java:210)
           at net.sf.saxon.expr.AnalyzeMappingFunction.map(AnalyzeMappingFunction.java:54)
           at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:62)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:59)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:27)
           at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:107)
           at net.sf.saxon.expr.CardinalityCheckingIterator.<init>(CardinalityCheckingIterator.java:48)
           at EE_treatAs_01810261598.process(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:84)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:143)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:188)
           at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:519)
           at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:557)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:438)
           at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:733)
           at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:347)
           at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:311)
           at net.sf.saxon.Transform.processFile(Transform.java:1276)
           at net.sf.saxon.Transform.doTransform(Transform.java:804)
           at net.sf.saxon.Transform.main(Transform.java:80)
   java.lang.RuntimeException: Internal error evaluating template rule  at line 19 in module file:/C:/test/test.xsl
           at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:156)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:188)
           at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:519)
           at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:557)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:438)
           at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:733)
           at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:347)
           at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:311)
           at net.sf.saxon.Transform.processFile(Transform.java:1276)
           at net.sf.saxon.Transform.doTransform(Transform.java:804)
           at net.sf.saxon.Transform.main(Transform.java:80)
   Caused by: java.lang.ClassCastException: net.sf.saxon.value.StringValue cannot be cast to net.sf.saxon.om.NodeInfo
           at EE_EE_NonMatchingExpr_72005028997.iterate(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.iterate(CompiledExpression.java:210)
           at net.sf.saxon.expr.AnalyzeMappingFunction.map(AnalyzeMappingFunction.java:54)
           at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:62)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:59)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:27)
           at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:107)
           at net.sf.saxon.expr.CardinalityCheckingIterator.<init>(CardinalityCheckingIterator.java:48)
           at EE_treatAs_01810261598.process(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:84)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:143)
           ... 11 more
   java.lang.RuntimeException: Internal error evaluating template rule
           at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:371)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:519)
           at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:557)
           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:438)
           at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:733)
           at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:347)
           at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:311)
           at net.sf.saxon.Transform.processFile(Transform.java:1276)
           at net.sf.saxon.Transform.doTransform(Transform.java:804)
           at net.sf.saxon.Transform.main(Transform.java:80)
   Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 19 in module file:/C:/test/test.xsl
           at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:156)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:188)
           at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
           ... 9 more
   Caused by: java.lang.ClassCastException: net.sf.saxon.value.StringValue cannot be cast to net.sf.saxon.om.NodeInfo
           at EE_EE_NonMatchingExpr_72005028997.iterate(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.iterate(CompiledExpression.java:210)
           at net.sf.saxon.expr.AnalyzeMappingFunction.map(AnalyzeMappingFunction.java:54)
           at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:62)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:59)
           at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:27)
           at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:107)
           at net.sf.saxon.expr.CardinalityCheckingIterator.<init>(CardinalityCheckingIterator.java:48)
           at EE_treatAs_01810261598.process(file:/C:/test/test.xsl:19)
           at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:84)
           at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:143)
           ... 11 more
   Fatal error during transformation: java.lang.RuntimeException: Internal error evaluating template rule


Please register to edit this issue

Also available in: Atom PDF