Changes

Jump to navigation Jump to search
600 bytes added ,  14:05, 13 July 2020
As the positional test refers to the city child step, a rewritten query would yield different steps.
 
Paths may contain predicates that will be evaluated again by a later axis step. Such predicates are either shifted down or discarded:
 
<syntaxhighlight lang="xquery">
(: equivalent query :)
a[b]/b[c/d]/c
 
(: will be rewritten to :)
a/b/c[d]
</syntaxhighlight>
 
Names of nodes can be specified via name tests or predicates. If names are e.g. supplied via external variables, the predicates can often be dissolved:
 
<syntaxhighlight lang="xquery">
declare variable $name external := 'city';
db:open('addressbook')//*[name() = $name]
 
(: rewritten to :)
db:open('addressbook')//city
</syntaxhighlight>
=Changelog=
Introduced with Version 9.4.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu