Thank you, it works :)
What about the error? error: [XPTY0019] descendant::subj: node expected, xs:boolean found: false().
Any idea please?



De : Maximilian Gärber <mgaerber@arcor.de>
À : Mohamed kharrat <med_khr@yahoo.fr>
Cc : BaseX Talk <basex-talk@mailman.uni-konstanz.de>
Envoyé le : Mardi 19 juillet 2016 17h44
Objet : Re: [basex-talk] querying database

Hi,

you do not need to use doc() or collection() if your documents are
stored in a database.

The documents are just nodes as well, so doing something like:

let $db :=  db:open('some-db')
for $d in $db//item/@qcode="tx"
return $d

would return the items from all nodes (all files)

BTW: I guess you want: $db// item[@qcode="tx"]

Regards,
Max

2016-07-19 18:33 GMT+02:00 Mohamed kharrat <med_khr@yahoo.fr>:
> Hi,
> i have created a database in BaseX GUI but i did not understand how to use
> it inside FLWR query.
> So  since i would like to create one FLWR query to query all my files in the
> database not only one file with doc()
> i have tried collection()  is that right? (i have putted all my xml files
> inside path/ directory)
> This is my query:
>
> let $d:= collection ("path/")
> let $r:= doc("myfile1.xml")
> for $d in $d// item/@qcode="tx"
> where $d//subj[text() contains text { 'Hal', 'Fade' } any] and $r/subj
> ="Berlin"
> return
> <results>$d/tit</results>
>
>
> it shows me error: [XPTY0019] descendant::subj: node expected, xs:boolean
> found: false().
>
> what is that error about?
> ----
> Thank you
> Best regards