Project

Profile

Help

Bug #4914

Parameters supplied in SaxonJS.transform options not converted correctly for typed array required types

Added by Debbie Lockett 8 days ago. Updated 8 days ago.

Status:
New
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2021-02-18
Due date:
% Done:

0%

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

Description

Using the stylesheetParams option for SaxonJS.transform, strong conversion (as documented at https://www.saxonica.com/saxon-js/documentation/index.html#!xdm/conversions) for a stylesheet parameter with a typed array required type (i.e. which specifies the types of the array members), e.g. array(xs:string) or array(xs:integer), does not work correctly.

For instance supplying:

"stylesheetParams": {"arrayStr": [["a","b","c"]]}

For the stylesheet parameter:

<xsl:param name="arrayStr" select="['x','y']" as="array(xs:string)"/>

Results in the error:

"Supplied value [xs:untypedAtomic('a'),xs:untypedAtomic('b'),xs:untypedAtomic('c')] does not match required type array(xs:string) in stylesheet parameter Q{}arrayStr"

It appears that the function conversion rules have not been applied to the array members, so they have not been cast to the required type.

History

#1 Updated by Debbie Lockett 8 days ago

See Saxon API tests: async-trans-028b, async-trans-029b, async-trans-030b.

Note that it is possible to avoid this problem with strong conversion by using SaxonJS.atom, e.g. the following works:

"stylesheetParams": {"arrayStr": [[SaxonJS.atom("a"), SaxonJS.atom("b"), SaxonJS.atom("c")]] }

Please register to edit this issue

Also available in: Atom PDF Tracking page