jn:parse-json($arg as xs:string?, $options as object()) as json-item()*
jn:parse-json($arg as xs:string?) as json-item()*
$options("jsoniq-multiple-top-level-items")
evaluates to the empty sequence, or the second parameter is not specified, it is considered to be true.
$options("jsoniq-multiple-top-level-items")
is not of type xs:boolean
, then jerr:JNTY0020
is raised..
$options("jsoniq-multiple-top-level-items")
is true, then jn:parse-json recognizes and parses sequences of objects and arrays, with no separation other than whitespaces.
jerr:JNDY0021
is raised. Parsing is considered in particular to be non-successful if $options("jsoniq-multiple-top-level-items")
is false and there is extra content after parsing a single abject or array.
parse-json("{"foo" : "bar"} {"bar" : "foo"} [ 1, 2, 3 ]")
{ "foo" : "bar" } { "bar" : "foo" } [ 1, 2, 3 ]