Project

Profile

Help

Bug #2941

Crash when there is no context item

Added by Michael Kay over 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Low
Assignee:
-
Sprint/Milestone:
-
Start date:
2016-09-15
Due date:
% Done:

100%

Applies to JS Branch:
0.9
Fix Committed on JS Branch:
0.9
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Given a stylesheet with

<xsl:template match="/" name="main">
<xsl:result-document href="#target" method="ixsl:replace-content">
<ul>
<xsl:for-each select="//*:test-set">
<li><a href="testSet.html?src={@file}">{@name}</a></li>
</xsl:for-each>
</ul>
</xsl:result-document>
</xsl:template>

and running it with initialTemplate:main (and no source document), it crashes with

TypeError: null is not an object (evaluating 'context.focus.current')

rather than failing with XPDY0002 as it should.

History

#1 Updated by Debbie Lockett over 1 year ago

  • Status changed from New to In Progress
  • Found in version set to 0.9

Fixed in transform.js, so that context.focus is set appropriately (to be a tracker over an empty iterator) when there is no source document.

Still to do: create a unit testing mechanism to test the Saxon-JS API, and in particular a test for this case.

#2 Updated by Debbie Lockett over 1 year ago

  • Status changed from In Progress to Resolved

Now marking as resolved as unit testing for Saxon-JS is in development; including a test for this bug.

#3 Updated by Debbie Lockett over 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 0.9.1

Bug fix applied in the Saxon-JS 0.9.1 beta release.

#4 Updated by Community Admin 10 months ago

  • Fixed in JS Release set to Saxon-JS 0.9.1
  • Applies to JS Branch 0.9 added
  • Fix Committed on JS Branch 0.9 added

Please register to edit this issue

Also available in: Atom PDF Tracking page