Bug #4530
closedNullPointerException with `<xsl:copy-of select="/"/>`
100%
Description
Norm Tovey-Walsh reports on the saxon-help mailing list:
In the course of debugging, I wanted to make sure the input actually contained something. I decided the least disruptive way to simply copy the input to the output was:
<xsl:template match="/"> <xsl:sequence select="/"/> </xsl:template>
It goes bang in 9.9.1-7 EE:
java.lang.NullPointerException
at net.sf.saxon.expr.Expression.getRetainedStaticContext(Expression.java:461)
at net.sf.saxon.expr.parser.LoopLifter.process(LoopLifter.java:50)
at net.sf.saxon.expr.parser.ExpressionTool.optimizeComponentBody(ExpressionTool.java:1213)
at com.saxonica.ee.trans.TemplateRuleInitializer.init(TemplateRuleInitializer.java:63)
at com.saxonica.ee.trans.TemplateRuleEE.initialize(TemplateRuleEE.java:85)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:509)
Updated by Michael Kay almost 4 years ago
RootExpression.typeCheck()
rewrites "/" as "." if the context item type is document-node()
(for streamability reasons, primarily). The rewrite is failing to copy static context and location information to the new expression, and this isn't defaulting to the information from the parent expression because the expression has no parent.
Updated by Michael Kay almost 4 years ago
- Status changed from New to Resolved
- Applies to branch 10 added
- Fix Committed on Branch 10, 9.9 added
Updated by O'Neil Delpratt almost 4 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.1 added
Bug fix committed in the Saxon 10.1 maintenance release.
Updated by O'Neil Delpratt over 3 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 10.2, 9.9.1.8 added
- Fixed in Maintenance Release deleted (
10.1)
Bug fix applied on the Saxon 9.9.1.8 maintenance release.
Please register to edit this issue