Changes

Jump to navigation Jump to search
1,428 bytes added ,  21:23, 9 August 2014
Created page with "This XQuery Module contains functions for manipulating arrays, which will officially be introduced with XQuery 3.1. =Conventions= All f..."
This [[Module Library|XQuery Module]] contains functions for manipulating arrays, which will officially be introduced with [[XQuery 3.1#Arrays|XQuery 3.1]].

=Conventions=

All functions in this module are assigned to the {{Code|http://www.w3.org/2005/xpath-functions/array}} namespace, which is statically bound to the {{Code|array}} prefix.<br/>

=Functions=

==array:size==
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|array:size|$input as array(*)|xs:integer}}
|-
| '''Summary'''
| Returns the number of members in the supplied array. Note that because an array is an item, the {{Code|fn:count}} function when applied to an array always returns {{Code|1}}.
|-
| '''Examples'''
|
* <code>array:size([1 to 10])</code> returns {{Code|10}}.
* <code>array:size(array { 1 to 10 })</code> returns {{Code|10}}.
|}

==array:serialize==

{| width='100%'
| width='120' | '''Signatures'''
|{{Func|map:serialize|$input as map(*)|xs:string}}<br/>
|-
| '''Summary'''
| This function is specific to BaseX. It returns a string representation of the supplied array. The purpose of this function is to get an insight into the structure of an array item; it cannot necessarily be used for reconstructing the original array.
|-
| '''Examples'''
|
* <code>array:serialize([ 1, (2, 3), 4 to 6 ])</code> returns <code>[1, (2, 3), (4, 5, 6)]</code>.
|}

[[Category:XQuery]]

=Changelog=

Introduced with Version 8.0.

[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu