Bug #5654
closed![Author: Debbie Lockett](https://www.gravatar.com/avatar/9c2ec304a5bec55af709863d87d5f6b7?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Debbie Lockett](https://www.gravatar.com/avatar/9c2ec304a5bec55af709863d87d5f6b7?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
SaxonJS 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).
Updated by Debbie Lockett almost 2 years ago
- Status changed from New to Resolved
- Fix Committed on JS Branch Trunk added
Code fix committed on main branch. The requiredParams
check is now:
if (!context.fixed.options.stylesheetParams.containsKey(Atomic.XS.QName.fromEQName(name)))
Also committed updates on the main branch: to the documentation to remove the restriction note; and to the xslt30 exceptions file to remove the exception for test initial-mode-003
.
Updated by Norm Tovey-Walsh almost 2 years ago
- Sprint/Milestone set to SaxonJS 3.0
Please register to edit this issue
Also available in: Atom PDF Tracking page