Project

Profile

Help

Bug #5654

closed

SaxonJS restriction: don't check parameters are supplied if they aren't used

Added by Debbie Lockett over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Low
Category:
XSLT Conformance
Sprint/Milestone:
Start date:
2022-08-19
Due date:
% Done:

0%

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

Description

It is documented (https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30) that

If a required stylesheet parameter is not actually used, then Saxon does not check that a value has been supplied.

The xslt30 test initial-mode-003 is included in the exceptions for this reason.

However the restriction only arises because of a bug in the code which attempts to check values are supplied for required parameters:

        requiredParams.map(function (name) {
            if (typeof context.fixed.options.stylesheetParams.get(Atomic.XS.QName.fromEQName(name)) === "undefined") {
                throw new XError("No value has been provided for required stylesheet parameter '" + name + "'", "XTDE0050");
            }
        });

stylesheetParams is a HashTrie. Rather than doing HashTrie.get() (which returns an empty array representing an empty sequence when the key is not in the hashtrie, not undefined), we should be using HashTrie.containsKey().

I'm proposing we fix this for SaxonJS 3, but leave the restriction for SaxonJS 2 (rather than make a change between maintenance releases).

Please register to edit this issue

Also available in: Atom PDF Tracking page