This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the "Examples" section of fn:json-to-xml, it's a bit surprising to have code in the XSLT syntax. Maybe it could be replaced with the following equivalent example: let $jsonstr := unparsed-text('http://example.com/endpoint') let $options := map { 'liberal': true(), 'fallback': function($char as xs:string) as xs:string { let $c0chars := map { '\u0000':'[NUL]', '\u0001':'[SOH]', '\u0002':'[STX]', ... '\u001E':'[RS]', '\u001F':'[US]' } let $replacement := $c0chars($char) return if (exists($replacement)) then $replacement else error(xs:QName('err:invalid-char'), 'Error: ' || $char || ' is not a terminal control char.') } } return json-to-xml($jsonstr, $options)
Thanks for the suggestion. The XSLT example was there because of my laziness when moving the spec from XSLT 3.0. I have adopted your revision, except to replace let $x:=A let $y:=B return C by let $x:=A, $y:=B return C to make it valid in XPath as well as XQuery.