The problem
I have a query that gets executed by eXist through the REST API, and it gets POSTed to the collection it needs to run on, e.g. /db/foo
or /db/bar
. In the query, I'd like to get the child collections of the current collection. That is: if posted on /db/foo
, I'd like the query return what xmldb:get-child-collections('/db/foo')
would return; if posted on /db/bar
, I'd like the query return what xmldb:get-child-collections('/db/bar')
would return. But of course, I don't want the path of the current collection to be hard-coded in the query.
What I tried
xmldb:get-child-collections('.')
, no luck,.
is not understood by eXist as "the current collection".- Looking for a function that returns the path to the current collection, like
pwd
would in a shell, but I couldn't find one.