eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
428 stars 179 forks source link

util:binary-doc() can't cope with relative paths (via XQuery) #818

Open christian-schwaderer opened 9 years ago

christian-schwaderer commented 9 years ago

I have a test sub-collection with two files: "test.xml" and "test.html5" (the latter stored as binary). Retrieving those files via an XQuery file stored in the very same sub-collection leads to different results.

While doc('test.xml') works perfectly, util:binary-doc('test.html5') fails. Same goes for util:binary-doc-available('test.html5'). (The absolute path util:binary-doc-available('/db/apps/test/binary/test.html5') also works, of course.)

mgraauw commented 5 years ago

Just ran into (apparently) the same issue, eXist 4.3.1, with absolute path:

xquery version "3.1"; let $do := xmldb:store-as-binary('/db/apps', 'hi.txt', 'hello world' ) return util:binary-doc('/db/apps/hi.txt')

This returns an empty sequence. The file is created, with text in it.

joewiz commented 5 years ago

@mgraauw I see your path in util:binary-doc() is absolute, not relative. A different issue, perhaps?

mgraauw commented 5 years ago

Not sure. I get 'empty sequence' on both relative and absolute paths with util:binary-doc, and 'true' on both paths with util:binary-doc-available. Seems to me something is amiss with util:binary-doc, maybe 2 issues, maybe just 1.