fn:serialize-json

This function serializes the supplied value in JSON format.

serialize-json($arg as item()*) ➔ xs:string

Arguments

 

$arg

item()*

The value to be serialized as a JSON string

Result

xs:string

serialize-json($arg as item()*, $options as map(*)) ➔ xs:string

Arguments

 

$arg

item()*

The value to be serialized as a JSON string

 

$options

map(*)

JSON serialization options

Result

xs:string

Namespace

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

Links to W3C specifications

XSLT 3.0 Specification

Notes on the Saxon implementation

This function, as defined in the July 2012 XSLT 3.0 Working Draft, is available since 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).

The function has since been dropped from the XSLT 3.0 Specification, as input can now be serialized using the serialize() function with the JSON output method, which is available since Saxon 9.7.

This function remains available in the Saxon implementation for the time being.

See also:

fn:serialize()