Changes

Jump to navigation Jump to search
710 bytes added ,  22:12, 22 January 2015
no edit summary
The syntax makes nested function calls more readable, as it is easy to see if parentheses are balanced.
==Serialization== Two [[Serialization]] methods have been added to the [http://www.w3.org/TR/xslt-xquery-serialization-31/ Serialization spec]: ===Adaptive Serialization=== In {{Version|8.0}} of BaseX, {{Code|adaptive }} is the new default serialization method. It provides a textual representation for all XDM types, including maps and arrays, functions, attributes, and namespaces. All items will be separated using the value of the {{Code|item-separator}} parameter, or a newline if no value is specified: <pre class="brush:xquery"><element id='id0'/>/@id,map { 'key': 'value' },true#0</pre> Result: <pre class="brush:xml"> id="id0"{ "key": "value"}function true#0</pre> ===JSON Serialization===
The new {{Code|json}} serialization output method can be used to serialize XQuery maps, arrays, atomic values and empty sequences as JSON.
* If an XML node of type {{Code|element(json)}} is found, it will be serialized following the serialization rules of the [[JSON Module]].
* Any other node or atomic value, map, array, or empty sequence will be serialized according to the [http://www.w3.org/TR/xslt-xquery-serialization-31/ Official Specification#json-output rules in the specification].
The following two queries will both return the JSON snippet <code>{ "key": "value" }</code>:
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu