Hi,


I have the following query:

count(

for $r in doc("hib_parses.xml")//row

let $i := doc("hib_lemmas.xml")//row[field[@name="lemma_lang_id"][. = "3"]]

where $r/field[@name="lemma_id"] = $i/field[@name="lemma_id"]

return 
$r

)

I have noticed that the where clause needs to be changed into $r/field[@name="lemma_id"]/text() = $i/field[@name="lemma_id"]/text() in order to get a result (otherwise the query seems to never end).
I am wondering whether this is a BaseX issue, in that I would assume that the two kinds of where clause are equivalent (because of atomization). I have also noticed that /data() does not work either. Thanks!

Best,
Giuseppe