Project

Profile

Help

Bug #3706

closed

Array out of bounds exception results from function in template predicate

Added by J. G. over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2018-02-28
Due date:
% Done:

100%

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

Description

A template with a function in a predicate in combination with xsl:next-match is resulting in an array out of bounds exception.

Versions affected

I have reproduced this error in Saxon HE 9.8.0.8 and 9.7.0.19. It does not affect HE 9.6.0.8. I have tested with both Java and .NET releases of Saxon.

Steps to reproduce

  • Convert the attached input.xml using the attached convert.xsl in Saxon HE 9.8.0.8.

Expected results

  • The transform produces an empty XML document.

  • Note that you can still reproduce the error even if you alter the XSLT to ensure that a root element should be in the output.

Actual results

  • You get an exception stack trace such as the attached exception stacktrace.txt. Here is an initial summary:
java.lang.RuntimeException: Internal error evaluating template rule  at line 14 in module file:/C:/Users/jgomez/Desktop/saxon-bug.xsl
	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(Unknown Source)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:447)
	at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433)
...

Files

exception stacktrace.txt (3.35 KB) exception stacktrace.txt The exception stacktrace J. G., 2018-02-28 19:06
convert.xsl (1.18 KB) convert.xsl Sample transform that reproduces bug J. G., 2018-02-28 19:06
input.xml (10 Bytes) input.xml Sample input document that reproduces bug J. G., 2018-02-28 19:06

Related issues

Related to Saxon - Bug #3508: Internal error evaluating template rule (involves xsl:next-match)ClosedMichael Kay2017-11-01

Actions
Related to Saxon - Bug #2818: xsl:next-match as last instruction in a named template causes IndexOutOfBoundsExceptionClosedMichael Kay2016-07-02

Actions

Please register to edit this issue

Also available in: Atom PDF