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

Re: Base URIs vs. Document URIs.

From: Jason Diamond <jason@injektilo.org>
Date: Fri, 11 Jan 2002 11:06:09 -0800
Message-ID: <001d01c19ad3$0d6abb00$02265fa6@ck3162154a>
To: <uri@w3.org>
> I'm gathering you want resolveURI to take any URI ref and return an
> absolute URI reference.


> Instead, what I would do is define resolveURI as a function that
> takes any URI-reference-up-to-but-not-including-the-fragment-id [1] and
> returns the appropriate absolute URI.  The fragment id part is never
> sent to resolveURI and is always re-appended to what resolveURI returns

I based my implementation on the example algorithm in Section 5.2. Despite
being titled "Resolving Relative References to Absolute Form", it does cover
non-relative URI references (see step 3). Step 2 covers the case where the
URI reference is the empty string or just a fragment identifier. In that
case, it states the the reference is a "reference to the current document
and we are done".

Hmm. Looking at this paragraph again, I now think that it might be slightly
flawed. It says "and we are done". It doesn't mention that the fragment
identifier, if present, should be appended to the URI of the current

> In this model, if resolveURI is handed a null string, it just returns
> a null string and the calling code would know to use the fragment id
> to access into the current resource without anyone having to talk
> about a document URI (which may not exist if, say, you're working
> on some in-memory view of a dynamic document--and even if there is
> such a URI, you wouldn't want to use the URI to do a fetch of the
> document that is the current one anyway).

I'm fairly certain that my implementation will produce the correct result as
would the model that you suggest above. It passes all of the tests in
Appendix C. I'm actually working on an RDF parser (in XSLT) so am not
fetching any resources but I do need to convert all URI references to their
absolute form and would like that encapsulated into a single function.

I really appreciate you taking the time to discuss this with me.

Received on Friday, 11 January 2002 14:10:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:03 UTC