Changes

Jump to navigation Jump to search
476 bytes added ,  13:15, 23 November 2023
no edit summary
| {{Code|util:duplicates}}
| [https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-duplicate-values <code>fn:duplicate-values</code>]
|- valign="top"
| {{Code|util:if}}
| <code>if($test) { $then } else { $else }</code> (with the new syntax, the else branch is optional)
|- valign="top"
| {{Code|util:init}}
All functions and errors in this module and errors are assigned to the <code><nowiki>http://basex.org/modules/util</nowiki></code> namespace, which is statically bound to the {{Code|util}} prefix.<br/>
=Range Conditionsand Ranges==util:if== {| width='100%'|- valign="top"| width='120' | '''Signature'''|<pre>util:if( $condition as item()*, $then as item()*, $else as item()* := ()) as item()*</pre>|- valign="top"| '''Summary'''|Alternative writing for the if/then/else expression:* If the ''effective boolean value'' of {{Code|$condition}} is true, the {{Code|$then}} branch will be evaluated.* Otherwise, {{Code|$else}} will be evaluated. If the third argument is omitted, an empty sequence will be returned.|- valign="top"| '''Examples'''|* <code>util:if(true(), 123, 456)</code> returns {{Code|123}}.* <code>util:if(0, 'wrong!')</code> returns an empty sequence.|}
==util:count-within==
;Version 9.5
* Added: {{Function|Code|util:intersperse}}, {{Function|Code|util:within}}, {{Function|Code|util:duplicates}}, {{Function|Code|util:array-members}}, {{Function|Code|util:array-values}}, {{Function|Code|util:map-entries}}, {{Function|Code|util:map-values}}* Updated: {{Function|Code|util:replicate}}: Third argument added.
;Version 9.4
;Version 9.2
* Added: {{Function|Code|util:chars}}, {{Function|Code|util:init}}* Updated: {{Function|Code|util:item}}, {{Function|Code|util:last}}, {{Function||util:range}} renamed (before: {{Code|util:item-at}}, {{Code|util:item-range}}, {{Code|util:last-from}})
;Version 9.1
* Added: {{Function||util:if}}, {{Function|Code|util:or}}
;Version 9.0
* Added: {{Function|Code|util:replicate}}
The Module was introduced with Version 8.5.
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu