parse-json

This function takes as input a string in JSON format and parses it typically returning a map.

parse-json($arg as xs:string) ➔ xs:string

Arguments

 

$arg

xs:string

The JSON input to be parsed

Result

xs:string

parse-json($arg as xs:string, $options as map(*)) ➔ document-node(element(*, xs:untyped))

Arguments

 

$arg

xs:string

The JSON input to be parsed

 

$options

map(*)

Parsing options

Result

document-node(element(*, xs:untyped))

Links to W3C specifications

Namespace: http://www.w3.org/2005/xpath-functions

Applies to: XSLT 3.0 only (if enabled in Saxon: requires Saxon-PE or Saxon-EE)

XSLT 2.1 Specification

Notes on the Saxon implementation

Implemented since Saxon 9.4, provided XPath 3.0 is enabled. The parsing options provided are those listed in the XSLT 3.0 specifications.