Project

Profile

Help

Internal error evaluating template (Saxon-HE 9.6.0-6)

Added by Vladimir Nesterovsky over 9 years ago

Hello!

I've run into a simple example that throws an error. Please consider:


  
       
    
  

This produces:

Exception in thread "main" java.lang.RuntimeException: Internal error evaluating template  at line 3 in module ICE9.6.xslt
	at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:349)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1124)
	at net.sf.saxon.Controller.transformDocument(Controller.java:2106)
	at net.sf.saxon.Controller.transform(Controller.java:1705)
	at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:547)
	at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:179)
      ...
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:601)
	at java.lang.Long.parseLong(Long.java:631)
	at net.sf.saxon.expr.GeneralComparison.quickCompare(GeneralComparison.java:966)
	at net.sf.saxon.expr.GeneralComparison.compare(GeneralComparison.java:775)
	at net.sf.saxon.expr.GeneralComparison.evaluateManyToOne(GeneralComparison.java:656)
	at net.sf.saxon.expr.GeneralComparison.evaluateItem(GeneralComparison.java:547)
	at net.sf.saxon.expr.GeneralComparison.evaluateItem(GeneralComparison.java:38)
	at net.sf.saxon.expr.Expression.process(Expression.java:545)
	at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:338)
	... 8 more

Replies (2)

RE: Internal error evaluating template (Saxon-HE 9.6.0-6) - Added by Michael Kay over 9 years ago

Thanks for reporting it. I've reproduced the problem and made it into W3C test case math-0106. Saxon has a fast path for comparing strings to numbers without fully parsing the number, and this is failing when the string is zero-length. The correct outcome, I think, is dynamic error FORG0001.

    (1-2/2)

    Please register to reply