Actions
Bug #5579
closedsaxon:transform() no longer works correctly with stylesheets without primary output
Start date:
2022-06-23
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java
Description
When upgrading from Saxon-EE 10.8 to 11.3 we get an error message when using saxon:transform() with stylesheets without primary output:
java.lang.NullPointerException
at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:562)
at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:852)
at net.sf.saxon.expr.parser.Evaluator$OptionalItem.evaluate(Evaluator.java:201)
at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:469)
at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:560)
at net.sf.saxon.expr.parser.Evaluator$EagerSequence.evaluate(Evaluator.java:304)
at net.sf.saxon.expr.instruct.WithParam.getSelectValue(WithParam.java:317)
at net.sf.saxon.expr.instruct.Instruction.assembleParams(Instruction.java:204)
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:429)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:561)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:386)
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:446)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755)
at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:185)
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266)
at net.sf.saxon.trans.XsltController.callTemplate(XsltController.java:873)
at net.sf.saxon.s9api.Xslt30Transformer.callTemplate(Xslt30Transformer.java:483)
at net.sf.saxon.Transform.processFile(Transform.java:1380)
at net.sf.saxon.Transform.doTransform(Transform.java:869)
at net.sf.saxon.Transform.main(Transform.java:81)
See also bug #4403.
Files
Updated by Michael Kay over 2 years ago
Thanks for reporting it. Problem reproduced on the 12.x branch.
The documentation says that saxon:transform should return an empty sequence in this situation. The call() method is incorrectly returning null.
Updated by Michael Kay over 2 years ago
- Category set to Saxon extensions
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch trunk added
- Fix Committed on Branch 11, trunk added
- Platforms .NET, Java added
Fixed with a simple check in TransformFn.call() to return EmptySequence rather than null.
Updated by Johan Gheys over 2 years ago
Thank you for such an impressive response speed
Updated by Debbie Lockett over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.4 added
Bug fix applied in the Saxon 11.4 maintenance release.
Please register to edit this issue
Actions