Bug #3177
closedNPE when compiling XSLT with Saxon 9.7
100%
Description
If you download this project:
https://github.com/AntennaHouse/pdf5-ml/tree/develop-glossarylist-201703
and try to compile a new transformer from "com.antennahouse.pdf5.ml\xsl\dita2fo_import.xsl" using Saxin PE 9.7.0.15 you get:
java.lang.NullPointerException: Internal error: expression () has no retained static context
at net.sf.saxon.expr.Expression.getPackageData(Expression.java:1129)
at net.sf.saxon.expr.instruct.Choose.optimize(Choose.java:485)
at net.sf.saxon.expr.Operand.optimize(Operand.java:200)
at net.sf.saxon.expr.Expression.optimizeChildren(Expression.java:515)
at net.sf.saxon.expr.instruct.Block.optimize(Block.java:566)
at net.sf.saxon.expr.parser.ExpressionTool.optimizeComponentBody(ExpressionTool.java:1087)
at net.sf.saxon.style.XSLTemplate.optimize(XSLTemplate.java:820)
at net.sf.saxon.style.PrincipalStylesheetModule.optimizeTopLevel(PrincipalStylesheetModule.java:1374)
at net.sf.saxon.style.PrincipalStylesheetModule.compile(PrincipalStylesheetModule.java:1224)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:265)
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:260)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:101)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:859)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:177)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTransformer(SaxonTransformerFactory.java:131)
With Saxon 9.6 this issue cannot be reproduced according to our end user.
Updated by Michael Kay over 7 years ago
- Category set to Internals
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 9.7, 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Reproduced from the command line.
When a choose (or if expression) is optimized away, the static context isn't being copied to the replacement expression.
I think the particular optimization is happening in indexCommon.xsl, rewriting if (($see=$nextSee) and $prmStart) then true() else false()
(line 1362) as ($see=$nextSee) and $prmStart
.
Patch committed.
Updated by Radu Coravu over 7 years ago
Thanks MK, we tested the patch and the NPE can no longer be reproduced, we'll incorporate it as a patch for the custom Saxon 9.7.0.15 build we will ship with Oxygen 19.1.
Updated by O'Neil Delpratt over 7 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.18 added
Bug fix applied in the Saxon 9.7.0.18 maintenance release.
Updated by O'Neil Delpratt over 7 years ago
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue