And:
XQuery has no formal notion of files inside a database/collection
http://stackoverflow.com/questions/3363442/refer-to-a-specific-document-in-a-basex-db-using-xquery
With kind regards,
Menashè
On 04/30/2015 02:49 PM, Menashè Eliezer wrote:
Hello,
I'm using Java org.xmldb.api package for accessing the Basex server
(xmldb:basex://...)
After getting the resultSet I need to make further queries about the
requested subset (for reporting, etc.)
I have seen that getId() cannot be used since the Resource will be
anonymous if it is obtained as the result of a query.
Source: http://xmldb-org.sourceforge.net/xapi/api/index.html
The queries are not fixed and are based on end user selection.
I couldn't find a way to have a direct access/reference to a document.
In my case the ID is simply the filename, but it doesn't seem to be so
efficient.
I wonder if creating a temporal collection for the subset would be
faster than making query/queries similar to the following example in
which there are only two ids, but I can have thousands of them:
let $ids := ('360836','300139')
for $x in collection("collection_name")
let $filename := substring-after(base-uri($x),'/')
let $id := substring-before($filename,'.')
where $id = $ids
return ...
--
With kind regards,
Menashè