Ciao Giuseppe, Interesting indeed. I have improved the static typing of group by variables; it should work with the new snapshot [1]. If you want to stick with the current release, you can wrap the key with a string() function: for $u in db:open("db1")/text/s/t group by $k := $u/f || "#" || $u/@o where db:open("db2")/text/line[text() = string($k)] let $n := count($u) order by $n descending return $k || " " || $n Spero che questo aiuta, Christian [1] http://files.basex.org/releases/latest/ On Tue, Sep 19, 2017 at 5:10 PM, Giuseppe Celano <celano@informatik.uni-leipzig.de> wrote:
Hi Christian,
It works only if I substitute your where clause with
where db:text("db2", $k)
Ciao, Giuseppe
On Sep 19, 2017, at 4:15 PM, Christian Grün <christian.gruen@gmail.com> wrote:
where db:open("db2")/text/line[text() = $k]