Changes

Jump to navigation Jump to search
844 bytes added ,  18:44, 8 March 2013
that have already been implemented in BaseX.
==General Enhanced FLWOR Expressions==
{{Mark|Introduced with Version 7.7:}}
for $city in $country//city[population > 1000000]
group by $name
return <&lt;country name='{ $name }'>&gt;{ $city/name }&lt;/country&gt;</pre> A new {{Code|count}} clause enhances the FLWOR expression with a variable that enumerates the iterated tuples. <pre class="brush:xquery">for $n in (1 to 10)[. mod 2 = 1]count $creturn &lt;number count="{ $c }" number="{ $n }"/&gt;</countrypre> The {{Code|allowing empty}} provides functionality similar to outer joins in SQL: <pre class="brush:xquery">for $n allowing empty in ()return 'empty? ' || empty($n)</pre> Window clauses extend FLWOR clauses by generating sub-sequences of the iterated tuples. More information can be found in the [http://www.w3.org/TR/2013/CR-xquery-30-20130108/#id-windows specification]. An example: <pre class="brush:xquery">for tumbling window $w in (2, 4, 6, 8, 10, 12, 14) start at $s when fn:true() only end at $e when $e - $s eq 2return &lt;window&gt;{ $w }&lt;/window&gt;
</pre>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu