Re: Is this use of BASE kosher?

Owen Rees (rtor@ansa.co.uk)
Mon, 31 Jul 95 07:57:23 EDT

"Peter K. Sheerin" <psheerin@best.com> writes:
> Additionally, Netscape doesn't quite behave as I would expect. The named
> locations in this case contain spaces, so it decides that the names
> (truncated at the first space) don't exist in the document, and so just
> reload it at the same location. This happens even though it forms the URL
> based on the BASE element (at least according to the status line).

The key question is whether or not URIs that appear in HTML are in their
encoded or unencoded form. I could not find a definitive answer in a quick
scan of draft-ietf-html-spec-04, but RFC1738 (URL) seems to suggest that they
should be encoded. If this is the case, the spaces ought to have been written
"%20". Note that knowing the starting condition is essential to avoid
ambiguity for "%25". I could create files called "%" and "%25" - which should
HREF="%25" refer to?

> Here's the RFC excerpt: (BTW, notice how the spec doesn't finish the
> relative URL with a closing slash. Is this how it should be done? I
> usually see it done with the slash at the end of directory names.)
[RFC text deleted]
> <!doctype html public "-//IETF//DTD HTML//EN">
> <HTML><HEAD>
> <TITLE>An example HTML document</TITLE>
> <BASE href="http://www.ics.uci.edu/Test/a/b/c">
> </HEAD><BODY>
> ... <A href="../x">a hypertext anchor</A> ...
> </BODY></HTML>
>
> A parser reading the example document should interpret the given
> relative URL "../x" as representing the absolute URL
>
> <URL:http://www.ics.uci.edu/Test/a/x>
>
> regardless of the context in which the example document was obtained.

Neither "c" nor "x" is necessarily a directory - the server need not have any such notion, and may have its own way to determine content type that is not based on file extensions, or anything else visible in the URL. This means that the combination rules must operate purely on the syntax of the URLs. The BASE is formatted text to be processed according to certain rules, and my reading of the latest draft is that is has avoided requiring that the BASE be a URL for the document, or for any other resource. (draft-ietf-html-specv3-00.txt still has this requirement, I assume that this will be changed in a future draft.)

Owen Rees
<rtor@ansa.co.uk>, <URL:http://www.ansa.co.uk/Staff/rtor.html>
Information about ANSA is at <URL:http://www.ansa.co.uk/>.