I am trying to find employees who work on projects located in Houston but the department the project is housed in is not located in Houston. I was trying to model the expression after this example of FLWOR expressions but the query doesn't return anything and it should return results.
edit: Here is the input.
xquery
let $doc := doc("~path/company.xml")
for $e in $doc//employee,
$d in $doc//department,
$p in $doc//projects
where $d/locations[location!="Houston"]
and $p/project[plocations="Houston"]
return <e>{$e/fname}{$e/lname}{$e/address}</e>
/