ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Parser error for conditional in "Order By" #223

Open charlessimpson opened 7 years ago

charlessimpson commented 7 years ago

XQuery allows an expression in an order by clause (https://www.w3.org/TR/xquery-30/#id-order-by-clause), for example:

xquery version "3.0";

let $data :=
    <data>
        <elem><x>1</x><y>b</y></elem>
        <elem><x>2</x><y>a</y></elem>
    </data>

let $ord-x := fn:true()

for $e in $data/elem
order by if ($ord-x) then $e/x else $e/y
return $e

But I get a parser error "Cannot resolve function 'if'".