Changes

Jump to navigation Jump to search
5 bytes added ,  12:56, 2 July 2020
m
Text replacement - "[http://en.wikipedia.org/" to "[https://en.wikipedia.org/"
This article is part of the [[XQuery|XQuery Portal]]. It provides a summary of the most important features of the [httphttps://www.w3.org/TR/xquery-31/ XQuery 3.1] Recommendation.
=Maps=
=Arrays=
An ''array'' is a function that associates a set of positions, represented as positive integer keys, with values. The first position in an array is associated with the integer {{Code|1}}. The values of an array are called its members. In the type hierarchy, array has a distinct type, which is derived from function. In BaseX, arrays (as well as sequences) are based on an efficient [httphttps://en.wikipedia.org/wiki/Finger_tree Finger Tree] implementation.
Arrays can be constructed in two ways. With the square bracket notation, the comma serves as delimiter:
=Serialization=
Two [[Serialization]] methods have been added to the [httphttps://www.w3.org/TR/xslt-xquery-serialization-31 Serialization spec]:
==Adaptive Serialization==
* 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 [httphttps://www.w3.org/TR/xslt-xquery-serialization-31/#json-output rules in the specification].
The following two queries will both return the JSON snippet <code>{ "key": "value" }</code>:
;Version 8.1
* Updated: arrays are now based on a [httphttps://en.wikipedia.org/wiki/Finger_tree Finger Tree] implementation.
Introduced with Version 8.0.
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu