Loading TOC...

xdmp.fromJsonString

xdmp.fromJsonString(
   $arg as String
) as Sequence

Summary

Parses a string as JSON, returning an item sequence.

Parameters
$arg JSON input to be parsed.

Usage Notes

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:arrays.

Any codepoints in the JSON string that aren't allowed in XML are rejected and an error is thrown.

Example

xdmp.fromJsonString('["a", null, false]');
=>
["a",null,false]

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy