You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let $uri := 'uri-test/docs/doc-01.xml'
let $doc1 := collection('uri-test/docs/doc-01.xml')
let $doc2 := doc($uri)
let $doc3 := doc('uri-test/docs/doc02.xml')
let $link := $doc3/*/link
let $baseURI := base-uri($link)
let $resolvedURI := resolve-uri($baseURI, string($link/@href))
return<result>
<doc1>{
$doc1
}</doc1>
<doc2>{
$doc2
}</doc2>
<doc3>{
$doc3
}</doc3>
<link-elem base-uri="{$baseURI}"
resolved-uri="{$resolvedURI}"
>
{$link}
</link-elem>
</result>
I get this failure from resolve-uri():
Base URI is not absolute: "doc2.xml".
The problem is that document-uri() returns "uri-test/docs/doc02.xml", which is not an absolute URI.
But it needs to be one for the normal XPath functions that expect absolute URIs to work.
Either the built-in implementation of document-uri() needs to recognize this URI as being absolute (because it starts with the name of a repository) or, better, BaseX needs to provide a URL scheme that can be used in this case, e.g. "basex://uri-test/docs/doc02.xml".
Without this, there's no way to use normal URI-manipulation functions.
For example, I'm trying to use @xml:base to determine the effective URL for a relative reference made within the scope of the @xml:base, but that fails within BaseX because of this issue.
The text was updated successfully, but these errors were encountered:
Given this document in a repo named "uri-test" at the location "/docs/doc02.xml":
and this query run from the admin panel:
I get this failure from resolve-uri():
Base URI is not absolute: "doc2.xml".
The problem is that document-uri() returns "uri-test/docs/doc02.xml", which is not an absolute URI.
But it needs to be one for the normal XPath functions that expect absolute URIs to work.
Either the built-in implementation of document-uri() needs to recognize this URI as being absolute (because it starts with the name of a repository) or, better, BaseX needs to provide a URL scheme that can be used in this case, e.g. "basex://uri-test/docs/doc02.xml".
Without this, there's no way to use normal URI-manipulation functions.
For example, I'm trying to use @xml:base to determine the effective URL for a relative reference made within the scope of the @xml:base, but that fails within BaseX because of this issue.
The text was updated successfully, but these errors were encountered: