Utility Module
Revision as of 14:34, 3 March 2016 by CG (talk | contribs) (Created page with "This XQuery Module contains various small utility and helper functions. Please note that some of the functions are used for internal query rewritings. They may...")
This XQuery Module contains various small utility and helper functions. Please note that some of the functions are used for internal query rewritings. They may be renamed or moved to other modules in future versions of BaseX.
Contents
Conventions
All functions in this module and errors are assigned to the http://basex.org/modules/util
namespace, which is statically bound to the util
prefix.
Function Items
util:function-annotations
Signatures | util:function-annotations($function as function(*)?) as map(xs:QName, xs:anyAtomicType*) |
Summary | Returns the annotations of the specified $function in a map.
|
Examples |
util:function-annotations(true#0)
declare %private function local:f() { 'well hidden' }; util:function-annotations(local:f#0) |
Sequences
util:item-at
Signatures | util:item-at($sequence as item()*, $position as xs:double) as item()? |
Summary | Returns the item from $sequence at the specified $position . Equivalent to $sequence[$position] .
|
Examples |
|
util:item-range
Signatures | util:item-range($sequence as item()*, $first as xs:double, $last as xs:double) as item()* |
Summary | Returns items from $sequence , starting at position $first and ending at $last . Equivalent to subsequence($sequence, $first, $last - $first + 1) .
|
Examples |
|
util:last-from
Signatures | util:last-from($sequence as item()*) as item()? |
Summary | Returns last item of a $sequence . Equivalent to $sequence[last()] .
|
Examples |
|
Changelog
The Module was introduced with Version 8.5.