Changes

Jump to navigation Jump to search
752 bytes added ,  15:52, 13 July 2020
(: rewritten to :)
db:text('factbook', 'Shenzhen')/parent::name
</syntaxhighlight>
 
Multiple element names and query strings can be supplied in a path:
 
<syntaxhighlight lang="xquery">
//*[(ethnicgroups, religions)/text() = ('Jewish', 'Muslim')]
 
(: rewritten to :)
db:text('factbook', ('Jewish', 'Muslim'))/(parent::*:ethnicgroups | parent::*:religions)/parent::*
</syntaxhighlight>
<syntaxhighlight lang="xquery">
db:open('factbook')/mondial/country [religions = 'Muslim'] (: yields 77 hits results :) [ethnicgroups = 'Greeks'] (: yields 2 hits results :)
(: rewritten to :)
db:text('factbook', 'Greeks')/parent::ethnicgroups/parent::country[religions = 'Muslim']
</syntaxhighlight>
 
If index access is possible within more complex FLWOR expressions, only the paths will be rewritten:
 
<syntaxhighlight lang="xquery">
for $country in //country
where $country/ethnicgroups = 'German'
order by $country/name[1]
return <country name='{ $country/@name }'/>
 
(: rewritten to :)
for $country in db:text('factbook', 'German')/parent::ethnicgroups/parent::country
order by $country/name[1]
return <country name='{ $country/@name }'/>
</syntaxhighlight>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu