W3C home > Mailing lists > Public > uri@w3.org > January 2002

Base URIs vs. Document URIs.

From: Jason Diamond <jason@injektilo.org>
Date: Fri, 11 Jan 2002 00:16:21 -0800
Message-ID: <010601c19a78$408f2300$6401a8c0@injektilo>
To: <uri@w3.org>
If I were to define a function that resolved a URI reference, would it look
something like the following?

String resolveURI(String uriReference, String baseURI, String documentURI)

I wouldn't have expected the third parameter, documentURI, to be necessary
but Appendix C.1 of RFC2396 makes me think otherwise. The ninth example
(where the URI reference is "#s") is resolved to "(current document)#s".
This is unlike every other example where they are all resolved against the
defined base URI of "http://a/b/c/d;p?q".

The document URI, if I'm not mistaken, is the URI of the document
entity--this can never change. The base URI, on the other hand, can be
changed by xml:base or HTML's BASE element, correct?

Is there any way to resolve something like "#s" against the base URI and not
the document URI?

Thanks for any clarifications you can offer,
Jason.
Received on Friday, 11 January 2002 03:16:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:15:30 GMT