W3C home > Mailing lists > Public > uri@w3.org > June 2004

Re: Relative URI resolution and fragments: editorial comment

From: Mike Brown <mike@skew.org>
Date: Sat, 19 Jun 2004 15:18:51 -0600 (MDT)
Message-Id: <200406192118.i5JLIpg3079511@chilled.skew.org>
To: uri@w3.org

> One thing I noticed while doing so surprised me. The fragment ID of the 
> base URI reference is never considered. Even if you're resolving a URI 
> such as "" (the empty string) against a URI such as 
> http://www.example.com/test#fragID the resolved URI is 
> http://www.example.com/test.
> 
> This isn't a problem, and I can see the sense of making URI resolution 
> work that way. However, it did surprise me. If there's any epxlicit 
> language in the spec that notes this, I didn't find it.
>
> I suggest adding 
> a sentence to section 5.2 that makes this epxlicit; something like "The 
> fragment in the base URI is ignored" or "The fragment in the base URI 
> always comes from the relative URI,never the base URI."

This brings to light what is perhaps a more important editorial oversight
in RFC 2396bis.

As you may have noticed, in RFC 2396, http://www.example.com/test#fragID 
couldn't be a base URI, since it didn't match the URI syntax; a fragment 
could only exist on a URI reference.

In RFC 2396bis, however, a fragment is allowed on a URI. But is it
allowed on a base URI? According to this, no:

  4.3 Absolute URI

  Some protocol elements allow only the absolute form of a URI
  without a fragment identifier. For example, defining a base URI
  for later use by relative references calls for an absolute-URI
  syntax rule that does not allow a fragment.

This seems to be the only mention of this restriction, which makes me
wonder if this bit of prose was an unintended holdover from RFC 2396.
If it is normative, I'd like to see it more directly stated, not used
only as an example.

In any case, the fact that the base URI's fragment is ignored during 
resolution of URI references is explicit enough by virtue of the pseudocode 
being normative, IMHO. I don't think it would hurt to heed your suggestion, 
though. Section 5.2.1 of RFC 2396 did have an explicit clause like that for 
query components.

What I would much rather see is an explicit mention, somewhere in sec. 5, 
of which grammar production a base URI should conform to, and perhaps also 
give me some guidance as to what to do if no valid base URI is available.

-Mike
Received on Saturday, 19 June 2004 17:18:52 UTC

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