Changes

Jump to navigation Jump to search
1,079 bytes added ,  13:32, 24 September 2013
==json:parse==
 
Updated with {{Version|7.7.2}}: options added
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|json:parse|$input as xs:string|element(json)}}<br/>{{Func|json:parse|$input as xs:string, $options as item()|element(json)}}
|-
| '''Summary'''
|Converts the JSON document specified by {{Code|$input}} to XML, and returns the result as {{Code|element(json)}} instance. The converted XML document is both well readable and lossless, i.e., the converted document can be serialized back to the original JSON representation.<br/>The {{Code|$options}} argument can be used to control the way the input is converted. The following options are available (they bear resemblance to the one specified in [http://www.w3.org/TR/xslt-30/#json XSLT 3.0]):* {{Code|spec}} determines the used JSON specification. Allowed values are RFC4627, ECMA-262, and liberal; the default is ({{Code|RFC4627}}).* {{Code|unescape}} determines whether escape sequences (marked by a backslash) in the input are expanded. The default is {{Code|true}}.* {{Code|format}} determines the conversion format. Allowed values are {{Code|json}}, {{Code|jsonml}}, and {{Code|map}}; the default is {{Code|true}}.Options can either be specified<br />* as children of an {{Code|<csv:options/>}} element; e.g.:<pre class="brush:xml"><csv:options> <csv:separator value=';'/> ...</csv:options></pre>* or as map, which contains all key/value pairs:<pre class="brush:xquery">{ 'separator' : ';', ... }</pre>
|-
| '''Errors'''
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu