Incomplete FLWOR expression: expecting 'return'
问题 I am having some trouble with the if-then-else command of the XQuery. Currently I am using BaseX to edit XQuery (if that matters!) if ($item/pf3:Current/pf3:Name) then ( let $Name := "None" ) else ( let $Name := data($item/pf3:Current/pf3:Name) ) This piece throws an error saying: [XPST0003] Incomplete FLWOR expression: expecting 'return'. 回答1: There is a small problem with your xquery. Here is the corrected version - let $Name := if ($item/pf3:Current/pf3:Name) then "None" else data($item