serialize-json

serialize($arg as item()*) → xs:string

Arguments

 

$arg

item()*

The value to be serialized as a JSON string

Result

xs:string

serialize($arg as item()*, $options as map(*)) → xs:string

Arguments

 

$arg

item()*

The value to be serialized as a JSON string

 

$options

map(*)

JSON serialization optionss

Result

xs:string

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

This function is specified in XSLT 3.0, and is newly supported in Saxon 9.4, provided XSLT 3.0 is enabled.

The options recognized are escape=true|false, indent=true|false, spec=RFC4234|ECMA-262, fallback=(function).