Changes

Jump to navigation Jump to search
1,103 bytes added ,  04:08, 4 January 2016
no edit summary
It lists specific extensions and optimizations of the BaseX XQuery processor.
 
=Annotations=
 
The following implementation-defined annotations are available:
 
* {{Code|%basex:inline([limit])}} enforces the inlining of a function. Example:
 
'''Example:'''
<pre class="brush:xquery">
declare option db:inlinelimit '0';
declare %basex:inline function local:id($x) { $x };
local:id(123)
</pre>
 
In this query, function inlining has been deactivated by setting [[Options#INLINELIMIT|inlinelimit]] to {{Code|0}}. The annotation enforces inlining for the given function, though, resulting in the optimized query expression {{Code|123}}.
 
If an integer is specified as annotation argument, it will be interpreted a local inline limit.
 
* {{Code|%basex:lazy}} enforces the lazy evaluation of a global variable. Example:
 
'''Example:'''
<pre class="brush:xquery">
declare %basex:lazy variable $january := doc('does-not-exist');
if(month-from-date(current-date()) == 1) then $january else ()
</pre>
 
The annotation ensures that an error will only be thrown if the condition yields true. Without the annotation, the error will always be thrown, because the referenced document is not found.
=Optimizations=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu