Project

Profile

Help

Bug #2941

closed

Crash when there is no context item

Added by Michael Kay over 7 years ago. Updated over 6 years ago.

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

100%

Estimated time:
Applies to JS Branch:
0.9
Fix Committed on JS Branch:
0.9
Fixed in JS Release:
SEF Generated with:
Platforms:
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.

Actions #1

Updated by Debbie Lockett over 7 years 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.

Actions #2

Updated by Debbie Lockett over 7 years 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.

Actions #3

Updated by Debbie Lockett over 7 years 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.

Actions #4

Updated by Community Admin over 6 years 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