Bug #5654
closedSaxonJS restriction: don't check parameters are supplied if they aren't used
0%
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