Bug #4914
openParameters 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 almost 4 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 over 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