Changes

Jump to navigation Jump to search
531 bytes added ,  13:56, 11 October 2016
==Adaptive Serialization==
The {{MarkCode|Updated with Version 8adaptive}} serialization provides a intuitive textual representation for all XDM types, including maps and arrays, functions, attributes, and namespaces.4All items will be separated by the value of the {{Code|item-separator}}parameter, which by default is a newline character. It is utilized by the functions <code>[[Profiling Module#prof:dump|prof:dump]]</code> and <code>[http://www.w3.org/TR/xpath-functions-31/#func-trace fn: adaptive serialization method was aligned with spectrace]</code>.
The {{Code|adaptive}} serialization provides a textual representation for all XDM types, including maps and arrays, functions, attributes, and namespaces. All items will be separated by the value of the {{Code|item-separator}} parameter, which by default is a newline character.Example:
<pre class="brush:xquery">
declare option output:method 'adaptive';
<element id='id0'/>/@id,
declare option outputxs:method 'adaptive';token("abc"),
map { 'key': 'value' },
true#0
<pre class="brush:xml">
id="id0"
xs:token("abc"),
map {
"key": "value"
==fn:sort==
 
{{Mark|Updated with Version 8.6:}} Collation argument was inserted between first and second argument.
; Signatures
* <code>fn:sort($input as item()*) as item()*</code>
* <code>fn:sort($input as item()*, $collation as xs:string?) as xs:anyAtomicType*)) as item()*</code>* <code>fn:sort($input as item()*, $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*)) as item()*</code>
Returns a new sequence with sorted {{Code|$input}} items, using an optional {{Code|$collation}}. If a sort {{Code|$key}} function is givensupplied, it will be applied on all items. The items of the resulting values will be sorted using the semantics of the {{Code|lt}} expression.
<pre class="brush:xquery">
sort(reverse(1 to 3)) (: yields 1, 2, 3 :),reverse(sort(1 to 3)) (: returns the sorted order in descending order :),sort((3, -2, 1), (), abs#1) (: yields 1, -2, 3 :),sort((1,2,3), (), function($x) { -$x }) (: yields 3, 2, 1 :),sort((1, 'a')) (: yields an error, as strings and integers cannot be compared :)
</pre>
==fn:default-language==
 
{{Mark|Introduced with Version 8.4:}}
Returns the default language used for formatting numbers and dates. BaseX always returns {{Code|en}}.
=Changelog=
 
;Version 8.6
 
* Updated: Collation argument was inserted between first and second argument.
;Version 8.4
;Version 8.1
* Updated: arrays are now based on an efficient a [http://en.wikipedia.org/wiki/Finger_tree Finger Tree] implementation.
Introduced with Version 8.0.
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu