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.

Cheers,

Eliot


—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 4/17/15, 10:51 AM, "Eliot Kimber" <ekim...@contrext.com> wrote:

>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 problem I'm running into is that the URLs used within BaseX are not
>absolute (that is, they don't start with "/".
>
>For example, document-uri(root($node)) returns:
>
>dfst^dfst-sample-project^develop/docs/tests/complex_map/complex_map.ditama
>p
>
>
>not 
>
>/dfst^dfst-sample-project^develop/docs/tests/complex_map/complex_map.ditam
>a
>p
>
>This causes a problem for resolve-uri(), used like this:
>
>resolve-uri($topicResourcePart, base-uri($topicref))
>
>
>This fails under BaseX:
>
>[FORG0002] Base URI is not absolute: "dfst^dfst-sample-project^develo....
>
>
>These libraries are intended to be generic XQuery so I'm trying to avoid
>having any BaseX-specific logic in these functions.
>
>Is there workaround or other solution to this?
>
>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
>
>
>
>


Reply via email to