Dear Basex People,
I have this fragment:
let $xml-doc := 'MyDatabase/bogus-entry.xml' let $list := *if (doc-available($xml-doc)) then doc($xml-doc)/** else () return $list
I'd expect BaseX to return the empty sequence when the document is not in the collection. But Basex returns an error:
[basex:doc] Database path 'MyDatabase/bogus-entry.xml' yields no documents.
What am I doing wrong? I thought I was following the example in https://docs.basex.org/wiki/Databases#XML_Documents nicely...
Thanks in advance!!
It seems that in VERSION 9.3 (November 29, 2019) the doc-available($xml-doc) seems to be broken; it should return a boolean but throws an exception.
Has this been fixed recently? Cannot find a reference to such a fix in GIT.
Arjan
---------- Forwarded message --------- Van: Arjan Loeffen arjan.loeffen@armatiek.nl Date: za 25 apr. 2020 om 17:55 Subject: Doc-available() function, behavior? To: BaseX basex-talk@mailman.uni-konstanz.de
Dear Basex People,
I have this fragment:
let $xml-doc := 'MyDatabase/bogus-entry.xml' let $list := *if (doc-available($xml-doc)) then doc($xml-doc)/** else () return $list
I'd expect BaseX to return the empty sequence when the document is not in the collection. But Basex returns an error:
[basex:doc] Database path 'MyDatabase/bogus-entry.xml' yields no documents.
What am I doing wrong? I thought I was following the example in https://docs.basex.org/wiki/Databases#XML_Documents nicely...
Thanks in advance!!
Hi Arjan,
The bug came in when we changed the error codes of db:open for non-existing documents (maybe that already happened with 9.0.x?). With the latest snapshot [1], fn:doc-available works for database documents again.
Thanks for the pointer, Christian
[1] http://files.basex.org/releases/latest/
On Sun, Apr 26, 2020 at 10:40 AM Arjan Loeffen arjan.loeffen@armatiek.nl wrote:
It seems that in VERSION 9.3 (November 29, 2019) the doc-available($xml-doc) seems to be broken; it should return a boolean but throws an exception.
Has this been fixed recently? Cannot find a reference to such a fix in GIT.
Arjan
---------- Forwarded message --------- Van: Arjan Loeffen arjan.loeffen@armatiek.nl Date: za 25 apr. 2020 om 17:55 Subject: Doc-available() function, behavior? To: BaseX basex-talk@mailman.uni-konstanz.de
Dear Basex People,
I have this fragment:
let $xml-doc := 'MyDatabase/bogus-entry.xml' let $list := if (doc-available($xml-doc)) then doc($xml-doc)/* else () return $list
I'd expect BaseX to return the empty sequence when the document is not in the collection. But Basex returns an error:
[basex:doc] Database path 'MyDatabase/bogus-entry.xml' yields no documents.
What am I doing wrong? I thought I was following the example in https://docs.basex.org/wiki/Databases#XML_Documents nicely...
Thanks in advance!!
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
[off topic] Other people talk of agility, BaseX does it: BaseXity.
Am Sonntag, 26. April 2020, 11:50:24 MESZ hat Christian Grün christian.gruen@gmail.com Folgendes geschrieben:
Hi Arjan,
The bug came in when we changed the error codes of db:open for non-existing documents (maybe that already happened with 9.0.x?). With the latest snapshot [1], fn:doc-available works for database documents again.
Thanks for the pointer, Christian
[1] http://files.basex.org/releases/latest/
On Sun, Apr 26, 2020 at 10:40 AM Arjan Loeffen arjan.loeffen@armatiek.nl wrote:
It seems that in VERSION 9.3 (November 29, 2019) the doc-available($xml-doc) seems to be broken; it should return a boolean but throws an exception.
Has this been fixed recently? Cannot find a reference to such a fix in GIT.
Arjan
---------- Forwarded message --------- Van: Arjan Loeffen arjan.loeffen@armatiek.nl Date: za 25 apr. 2020 om 17:55 Subject: Doc-available() function, behavior? To: BaseX basex-talk@mailman.uni-konstanz.de
Dear Basex People,
I have this fragment:
let $xml-doc := 'MyDatabase/bogus-entry.xml' let $list := if (doc-available($xml-doc)) then doc($xml-doc)/* else () return $list
I'd expect BaseX to return the empty sequence when the document is not in the collection. But Basex returns an error:
[basex:doc] Database path 'MyDatabase/bogus-entry.xml' yields no documents.
What am I doing wrong? I thought I was following the example in https://docs.basex.org/wiki/Databases#XML_Documents nicely...
Thanks in advance!!
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
Christian, I have installed the version referenced in your answer and the bug is solved. Thanks! Arjan
Op zo 26 apr. 2020 om 11:50 schreef Christian Grün < christian.gruen@gmail.com>:
Hi Arjan,
The bug came in when we changed the error codes of db:open for non-existing documents (maybe that already happened with 9.0.x?). With the latest snapshot [1], fn:doc-available works for database documents again.
Thanks for the pointer, Christian
[1] http://files.basex.org/releases/latest/
On Sun, Apr 26, 2020 at 10:40 AM Arjan Loeffen arjan.loeffen@armatiek.nl wrote:
It seems that in VERSION 9.3 (November 29, 2019) the
doc-available($xml-doc) seems to be broken; it should return a boolean but throws an exception.
Has this been fixed recently? Cannot find a reference to such a fix in
GIT.
Arjan
---------- Forwarded message --------- Van: Arjan Loeffen arjan.loeffen@armatiek.nl Date: za 25 apr. 2020 om 17:55 Subject: Doc-available() function, behavior? To: BaseX basex-talk@mailman.uni-konstanz.de
Dear Basex People,
I have this fragment:
let $xml-doc := 'MyDatabase/bogus-entry.xml' let $list := if (doc-available($xml-doc)) then doc($xml-doc)/* else
()
return $list
I'd expect BaseX to return the empty sequence when the document is not
in the collection. But Basex returns an error:
[basex:doc] Database path 'MyDatabase/bogus-entry.xml' yields no
documents.
What am I doing wrong? I thought I was following the example in
https://docs.basex.org/wiki/Databases#XML_Documents nicely...
Thanks in advance!!
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
-- Arjan Loeffen Armatiek BV & Armatiek Solutions BV 06-12918997
basex-talk@mailman.uni-konstanz.de