Re: Is this use of BASE kosher?

Peter K. Sheerin (psheerin@best.com)
Mon, 31 Jul 95 04:04:24 EDT

On 30 Jul 95 at 20:13, Larry Masinter wrote:

> I think the relationship of the destination URLs and the base is
> spelled out in RFC 1808, and that Section 10, "Appendix - Embedding
> the Base URL in HTML documents" is pretty explicit.

Aggreed. Thank's for the reference.

Now, then, I need to go chastise two people, so let me make sure I'm
getting the right two.

Postulation: We all aggree that the HTML spec and this RFC specify that a
browser should combine a relative URL with the specified BASE element,
period. So I then need to go tell the author of the document at HP and
Mosaic (which breaks this rule, and follows the links as the author
intended -- even though he was wrong in his BASE URL).

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).

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.)

-----------------------------------------------

10. Appendix - Embedding the Base URL in HTML documents

It is useful to consider an example of how the base URL of a document
can be embedded within the document's content. In this appendix, we
describe how documents written in the Hypertext Markup Language
(HTML) [3] can include an embedded base URL. This appendix does not
form a part of the relative URL specification and should not be
considered as anything more than a descriptive example.

HTML defines a special element "BASE" which, when present in the
"HEAD" portion of a document, signals that the parser should use the
BASE element's "HREF" attribute as the base URL for resolving any
relative URLs. The "HREF" attribute must be an absolute URL. Note
that, in HTML, element and attribute names are case-insensitive. For
example:

<!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.

******************************************************************************
* Peter K. Sheerin Technical Editor, | Work : psheerin@mfi.com *
* CADENCE Magazine & AutoCAD Tech Journal | CompuServe: 71621,3173 *
* 600 Harrison Street, San Francisco, CA | Personal : psheerin@best.com *
* *
* <URL:http://www.mfi.com/cadence/> <URL:http://www.best.com/~psheerin/> *
* <URL:http://www.mfi.com/atj/> *
******************************************************************************