W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2005

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

From: Michael Kay <mhk@mhk.me.uk>
Date: Wed, 9 Feb 2005 09:52:10 -0000
To: "'Colin Paul Adams'" <colin@colina.demon.co.uk>
Cc: "'Ashok Malhotra'" <ashok.malhotra@oracle.com>, "'K Karun'" <k.karun@oracle.com>, <public-qt-comments@w3.org>
Message-ID: <E1CyoWb-0005SL-VJ@frink.w3.org>

> 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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:23 UTC