ok i understand now. In fact i am looking for results which have this condition of qcode=tx . I do not want to know if it's true or false.
On Tue, Jul 19, 2016 at 6:23 PM +0100, "Christian Grün" christian.gruen@gmail.com wrote:
$d// item/@qcode="tx"
…returns a boolean value (true or false). Hence,
for $d in $d// item/@qcode="tx"
is the same as
for $d in true()
or
for $d in false()
As a result,
$d//subj
will give you an error (node expected, boolean found).
On Tue, Jul 19, 2016 at 7:16 PM, Mohamed kharrat wrote:
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 À : Mohamed kharrat Cc : BaseX Talk 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 :
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 $d/tit
it shows me error: [XPTY0019] descendant::subj: node expected, xs:boolean found: false().
what is that error about?
Thank you Best regards