Yes, resolve-uri('foo', '/bar') also fails.
If I do base-uri('/foo') I get "file:/foo", which is a bit unexpected since I'm in the context of the BaseX system and not in the context of the file system (at least that's why my head thinks: BaseX itself may have different ideas).
I think what I expect is either that BaseX interprets all URIs not prefixed with "file:/" as relative to the BaseX repository, so rather than "dbname/path/to/doc" the URL format would be"/dbname/path/to/doc" or there is a BaseX-specific scheme that is used with all absolute URIs, e.g. "basex:/dbname/path/to/doc". That would remove any potential ambiguity about the intent of a given URL.
Thus, document-uri(root($node)) would return either "/foo/bar" or "basex:/foo/bar", but not "foo/bar".
Cheers,
E. ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 4/17/15, 12:07 PM, "Christian Grün" christian.gruen@gmail.com wrote:
Hi Eliot,
This fails under BaseX:
[FORG0002] Base URI is not absolute: "dfst^dfst-sample-project^develo....
I think it also fails if the base URI starts with a slash. Try this for example:
resolve-uri('abc.xml', '/path/def.xml')
What result you would expect from this query, given that it did not raise an error?
Using string operations could be an alternative...
"replace($baseURI, '/[^*]+$', $topicResourcePart)
...but I am not sure if this fulfills all needs.
Christian
Obviously, this way of representing document URIs internally is not something that could be easily changed but it is definitely a problem in terms of the expectations of URI handling by built-in XQuery functions.
Thanks,
Eliot ————— Eliot Kimber, Owner Contrext, LLC http://contrext.com