Re: [basex-talk] URLs for BaseX Documents and resolve-uri()

2015-04-17 Thread Eliot Kimber
BTW, my workaround for now is to check to see if base-uri() returned an absolute URL and if it did not, I use my existing code for constructing URLs to simply combine the relative URL with the parent of the result of base-uri(), otherwise I use resolve-uri(). That's a sufficiently-general solution

Re: [basex-talk] URLs for BaseX Documents and resolve-uri()

2015-04-17 Thread Eliot Kimber
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

[basex-talk] URLs for BaseX Documents and resolve-uri()

2015-04-17 Thread Eliot Kimber
I'm migrating XSLT functions for working with DITA documents to XQuery. As part of this function package I have functions that resolve URI references from one document to another. This involves creating absolute URLs from relative URLs using a document or element as the base URI context. The

Re: [basex-talk] URLs for BaseX Documents and resolve-uri()

2015-04-17 Thread Christian GrĂ¼n
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

Re: [basex-talk] URLs for BaseX Documents and resolve-uri()

2015-04-17 Thread Eliot Kimber
Related question: is there a preferred way to determine from within an XQuery function that the current XQuery engine is BaseX? I know I could look to see if a particular BaseX-specific function exists but I was looking for something either more obvious or more general from an XQuery standpoint.