RE: [F&O] fn:resolve-uri and non-hierarchical base URI

> It is clear, I think. There is nothing that says that the xml:base
> attribute value must be absolute, therefore it can be relative.
> But the infoset says that the [bas URI] property is determined
> according to XML Base, and this says that the base URI of an element
> is the value of the xml:base attribute if it is present. so this
> property can be a relative URI that needs resolving.
> 
> Now fn:resolve-uri (first form) uses the base URI property from the
> static context, which is defined to be an absolute URI.

But the common use case for resolve uri is

resolve-uri(@href, base-uri(.))

so we need to ensure that base-uri(.) delivers an absolute URI. We could do
this either by saying that the base-uri() function takes the base-uri
property of the node and, if it is relative, resolves it recursively; or we
could say that the base-uri property of the node is the pre-resolved
absolute value. In other words, if a document with base URI
http://www.example.com/a/b/c/d.xml contains an element with the attribute
xml:base="../e.xml", the base-uri property of that element node should not
be "e.xml", but "http://www.example.com/a/b/e.xml". The distinction is not
academic, because it affects what happens when the node is copied. 

Michael Kay
http://www.saxonica.com/

Received on Wednesday, 9 February 2005 09:52:45 UTC