HTML 3.2: BASE element

I'm concerned that the definition of the <BASE> element in the HTML 3.2 DTD
(Draft: Tuesday 15-May-96) will break some existing browsers.

The HTML 2.0 Specification [RFC 1866] states that:

    5.2.2. Base Address: BASE

    The optional <BASE> element provides a base address for interpreting 
    relative URLs when the document is read out of context (see 7, 
    "Hyperlinks"). The value of the HREF attribute must be an absolute URI. 

However the 3.2 draft DTD states:

<!--
    The BASE element gives the base URL for dereferencing relative
    URLs, e.g.

         <BASE href="http://foo.com/images">
         ...
         <IMG SRC="bar.gif">

    The image is deferenced to

         http://foo.com/images/bar.gif

   In the absence of a BASE element the document URL should be used.
   Note that this is not necessarily the same as the URL used to
   request the document, as the base URL may be overridden by an HTTP
   header accompanying the document.
-->

<!ELEMENT BASE - O EMPTY>
<!ATTLIST BASE
        href %URL  #REQUIRED
        >

using an example which shows an incomplete URL, and in fact due to the lack
of a trailing slash (/) is ambiguous as to whether it is a file or directory
reference.

Many months ago I hassled (off and on) for a couple of months with a few
pages which used BASE and did not work right with certain browsers. I too
had given an incomplete URL, something which confused (each in differing
ways) a few browsers. Once I figured out that the browser authors took a
quite literal view of "absolute URL" and gave the <BASE> element the
complete URL, everything worked like a champ.

I will certainly agree that <BASE href="http://foo.com/images/"> (with slash
added) is a more intuitive usage than <BASE
href="http://foo.com/images/index.html">. I'd call it 20-20 hindsight.
However, I question whether making this change now, and breaking some
existing browsers, provides sufficient benefit to outweigh the hassle.

Consequently, I'd suggest changing the comment line:

         <BASE href="http://foo.com/images">

to read:

         <BASE href="http://foo.com/images/index.html">

in order to comply with RFC 1866. Repeating the sentence "The value of the
HREF attribute must be an absolute URI." from RFC 1866 would be desirable as
well.

/Harold
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Harold A. Driscoll                       mailto:harold@driscoll.chi.il.us
#include <std/disclaimer>      http://homepage.interaccess.com/~driscoll/

Received on Tuesday, 21 May 1996 12:51:46 UTC