fn:json-to-xml

Parses a string supplied in the form of a JSON text, returning the results in the form of an XML document node.

json-to-xml($json-text as xs:string?) ➔ document-node()?

Arguments

 

$json-text

xs:string?

The JSON input text

Result

document-node()?

json-to-xml($json-text as xs:string?, $options as map(*)) ➔ document-node()?

Arguments

 

$json-text

xs:string?

The JSON input text

 

$options

map(*)

Used to control the way in which parsing takes place

Result

document-node()?

Namespace

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

Links to W3C specifications

XPath 3.1 Functions and Operators

Notes on the Saxon implementation

Available since Saxon 9.7. The parsing options recognized are 'liberal':true()|false(), 'duplicates':'reject'|'use-first'|'retain', 'validate':true()|false(), 'escape':true()|false(), 'fallback':(function). For full details see the specification. Use of the fallback option requires Saxon-PE or Saxon-EE.

An earlier version of this function, as defined in the July 2012 XSLT 3.0 Working Draft, is implemented in Saxon 9.6, and available provided XPath 3.0 is enabled.

See also:

fn:parse-json()

fn:json-doc()

fn:xml-to-json()