Base element

According to the HTML 4.01 specification[1]:

   When present, the BASE element must appear in the HEAD section of an
   HTML document, before any element that refers to an external source.

So I think that the following document is invalid:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
    <HTML>
     <HEAD>
       <TITLE>BASE element</TITLE>
       <LINK type="text/css" rel="stylesheet" href="style.css">
       <BASE href="http://example.org/bar/">
     </HEAD>
     <BODY>
     <P>There is an external source specified <EM>before</EM> the BASE
     element.</P>
     </BODY>
    </HTML>

The HTML validator seems to be pretty happy about it though.

The DTD[2] reads:

  <!--================ Document Head =======================================-->
  <!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" -->
  <!ENTITY % head.content "TITLE & BASE?">
    
  <!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->

My understanding is that %head.content; must appear before %head.misc;
(well, it's not very clear by reading [3]), which means that it is a
validator problem.

  1. http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#h-12.4
  2. http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd
  3. http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html#h-3.3.3.1

-- 
Hugo Haas - W3C/MIT
mailto:hugo@w3.org - tel:+1-617-452-2092

Received on Monday, 9 October 2000 14:59:25 UTC