So im trying to execute this simple function:
declare function local:decodeBase64() as element(){
<root-element>
{
let $codepointsString := "77 97 110"
let $codepoints := fn:replace( $codepointsString,' ',', ')
let $x := fn:codepoints-to-string(xs:integer($codepoints))
return
$x
}
</root-element>
};
but i'm getting a error that i think it's because of xs:integer
however i can execute this code with the integer hardcoded
let $x := codepoints-to-string((77, 97, 110))
I noticed that i can run the code if i declare $codepoints as xs:integer* but i dont't know get a codePoint inside an element and use as xs:integer* to call codepoints-to-string function.
error:
http://www.w3.org/2005/xqt-errors}FORG0001: "77 97 110": invalid value for cast/constructor: {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: unexpected char '32'