xdmp.fromJsonString( arg as String ) as Sequence
Parses a string as JSON, returning an item sequence.
Parameters | |
---|---|
arg | JSON input to be parsed. |
A JSON object or string is parsed as a json:object
.
The JSON null value is represented as the empty sequence, and serializes
in a way that indicates it is a null value. Therefore, when the null value
is returned to JSON via xdmp:to-json
, the null value is
preserved.
Nested arrays in JSON are turned into nested sets of
json:array
s.
Any codepoints in the JSON string that aren't allowed in XML are rejected and an error is thrown.
xdmp.fromJsonString('["a", null, false]'); => ["a",null,false]