Project

Profile

Help

Bug #2561

closed

java.lang.NullPointerException with nested xsl:iterate

Added by David Rudel about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
XSLT conformance
Sprint/Milestone:
Start date:
2015-12-28
Due date:
% Done:

100%

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

Description

When using one iterate inside another iterate, I'm getting a java.lang.NullPointerException.

A repro script code is:

<xsl:template match="/">

	<xsl:iterate select="//row">

		<xsl:variable name="days.left" as="xs:integer">

			<xsl:iterate select="following-sibling::row">

				<xsl:param name="days" select="0"/>

				<xsl:on-completion>

					<xsl:sequence select="$days"/>

				</xsl:on-completion>

				<xsl:next-iteration>

					<xsl:with-param name="days" select="$days + 1"/>

				</xsl:next-iteration>

			</xsl:iterate>

		</xsl:variable>

		<day date="{@Date}" days.left="{$days.left}"/>

	</xsl:iterate>

</xsl:template>

I'm getting the error regardless of whether the internal iterate is inside a variable or not.


Files

nested_iterate_bug.xsl (732 Bytes) nested_iterate_bug.xsl David Rudel, 2015-12-28 13:59
Actions #1

Updated by David Rudel about 8 years ago

Uploading actual file.

Actions #2

Updated by Michael Kay about 8 years ago

  • Subject changed from java.lang.NullPointerException with nested iterate to java.lang.NullPointerException with nested xsl:iterate
  • Category set to XSLT conformance
  • Status changed from New to In Progress
  • Priority changed from Low to Normal
  • Applies to branch 9.6, 9.7 added

Thanks for reporting it. Have reproduced it on Saxon 9.7, running with the stylesheet itself as source document.

Actions #3

Updated by Michael Kay about 8 years ago

  • Status changed from In Progress to Resolved
  • Fix Committed on Branch 9.6, 9.7 added

Patch committed on the 9.6 and 9.7 branches. The recursive search for nested xsl:next-iteration instructions should not extend into a nested xsl:iterate instruction.

Actions #4

Updated by O'Neil Delpratt about 8 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.2 added

Bug fix applied in the Saxon 9.7.0.2 maintenance release

Actions #5

Updated by O'Neil Delpratt about 8 years ago

  • Fixed in Maintenance Release 9.7.0.3 added
  • Fixed in Maintenance Release deleted (9.7.0.2)

Bug fix applied in the 9.7.0.3 maintenance release. Leave open until fix applied in the 9.6 branch

Actions #6

Updated by O'Neil Delpratt almost 8 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.6.0.9 added
  • Fixed in Maintenance Release deleted (9.7.0.3)

Bug fix applied in the Saxon 9.6.0.9 maintenance release.

Actions #7

Updated by O'Neil Delpratt almost 8 years ago

  • Fixed in Maintenance Release 9.7.0.3 added
Actions #8

Updated by O'Neil Delpratt almost 8 years ago

  • Sprint/Milestone set to 9.7.0.3

Please register to edit this issue

Also available in: Atom PDF