Bug #4914
open![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)
Parameters supplied in SaxonJS.transform options not converted correctly for typed array required types
0%
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.
Updated by Debbie Lockett over 3 years 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")]] }
Updated by Norm Tovey-Walsh about 2 years ago
- Priority changed from Normal to High
- Sprint/Milestone set to SaxonJS 3.0
Please register to edit this issue
Also available in: Atom PDF Tracking page