Changes

Jump to navigation Jump to search
18 bytes removed ,  23:41, 8 July 2017
m
update fold-left syntax
This page contains code snippets that mainly originate from our [https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk basex-talk] mailing list.
== Compact XQuery Notations ==
<code>if</code>/<code>not</code>/<code>else</code> constructs can look pretty verbose in XQuery.
let $ip := '134.34.226.65'
return fold-left(
tokenize($ip, '\.')!xs:integer(.), 0, function($n, $d) { 256 * $n + $d }, 0, map(xs:integer#1, tokenize($ip, '\.'))
)
</pre>
find . | grep \.jpg$ | wc -l
</pre>
 
[[Category:XQuery]]
administrator, editor
31

edits

Navigation menu