Project

Profile

Help

RuntimeException executing XSLT 3.0 using an accumulator

Added by Martin Honnen over 9 years ago

I am experimenting with accumulators and have hit the following error when executing a test case with Saxon EE 9.6.0.4J:

java.lang.RuntimeException: Internal error evaluating template  at line 10 in module file:/C:/Users/user/Documents/xslt/test2015012403.xsl
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:353)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1155)
        at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1131)
        at net.sf.saxon.Controller.transformDocument(Controller.java:2105)
        at net.sf.saxon.Controller.transform(Controller.java:1704)
        at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:547)
        at net.sf.saxon.Transform.processFile(Transform.java:1056)
        at net.sf.saxon.Transform.doTransform(Transform.java:659)
        at net.sf.saxon.Transform.main(Transform.java:80)
Caused by: java.lang.RuntimeException: Internal error evaluating template  at line 10 in module file:/C:/Users/user/Documents/xslt/test2015012403.xsl
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:353)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1155)
        at EE____node___018147683.process(file:/C:/Users/user/Documents/xslt/test2015012403.xsl:13)
        at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:66)
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:342)
        ... 9 more
Caused by: java.lang.RuntimeException: Internal error evaluating template  at line 17 in module file:/C:/Users/user/Documents/xslt/test2015012403.xsl
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:353)
        at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1155)
        at EE____node___018147683.process(file:/C:/Users/user/Documents/xslt/test2015012403.xsl:13)
        at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:66)
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:342)
        ... 13 more
Caused by: java.lang.NullPointerException
        at net.sf.saxon.om.StructuredQName.fromLexicalQName(StructuredQName.java:124)
        at com.saxonica.functions.xslt3.AccumulatorFn.getAccumulatorValue(AccumulatorFn.java:83)
        at com.saxonica.functions.xslt3.AccumulatorFn.call(AccumulatorFn.java:144)
        at EE_h1_513038103.process(file:/C:/Users/user/Documents/xslt/test2015012403.xsl:21)
        at com.saxonica.ee.bytecode.CompiledExpression.process(CompiledExpression.java:66)
        at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:342)
        ... 17 more
Fatal error during transformation: java.lang.RuntimeException: Internal error evaluating template  at line 10 in module
file:/C:/Users/user/Documents/xslt/test2015012403.xsl

The stylesheet is





  



  
    
    
  



  
  
  
    

the test input sample is



  
    <title>Test 1</title>
  
  
    

Test 1

This is test 1.

I realize that use of the accumulator to access an element in a non-streaming processing is not very useful, I could as well navigate to the @title@ element, but I guess it shouldn't cause a runtime error either.


Replies (2)

RE: RuntimeException executing XSLT 3.0 using an accumulator - Added by Michael Kay over 9 years ago

Thanks for reporting it.

The variable containing the call on accumulator-before is being inlined, and in the process, the node in the expression tree representing the call on accumulator-before gets copied. The copy is being done incorrectly, in that it is losing the static context information needed to resolve any prefix in the first argument to accumulator-before().

I will raise a bug entry and commit a patch.

I have submitted the test case to the W3C test suite as accumulator-040, assuming your permission.

    (1-2/2)

    Please register to reply