Changes

Jump to navigation Jump to search
563 bytes added ,  20:52, 23 October 2014
===JSON Functions===
 
XQuery now provides native support for JSON objects. Objects can be parsed to XQuery items and serialized back to their original form.
====fn:parse-json====
<pre class="brush:xquery">
json-doc("http://ip.jsontest.com/")('ip') (: returns your IP address :)
</pre>
 
====Serialization====
 
{{Mark|Warning}}: BaseX has been using the {{Code|json}} output method for a while. With BaseX 8.0, the implementation of this method will be rewritten to comply with the new standard serialization rules. We will do our best to keep the updated code backward-compatible.
 
<pre class="brush:xquery">
(: will return { "key": "value" } :)
declare option output:method 'json';
map { "key": "value" }
</pre>
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu