W3C home > Mailing lists > Public > www-validator@w3.org > January 2005

Re: closing slash at the end of the base HTML tag leads to an error

From: Paul Norman <penorman@mac.com>
Date: Thu, 27 Jan 2005 22:59:47 -0500
To: Jordan Laszlo <Laszlo.Jordan@firstdata.com>
cc: www-validator@w3.org
Message-ID: <R02010400-1037-0D59632070E111D9B222001124301DAA@[69.194.65.139]>

> 
> I need to be conform both with HTML4.01 and XHTML.

It isn't possible to have a document that's both valid XHTML and
HTML4[1]. You could make both a XHTML and HTML4 version of the same 
document and serve the appropriate version to different browsers.

> The base element does not allow the closing tag at the end in HTML but 
> requires it in XHTML.

That's since in XHTML every tag needs to be closed.

> <base href="xyz" /> <!-- this is correct in XHTML but wrong in
HTML4.01
> <base href="xyz">   <!-- wrong in XHTML, but wrong in HTML4.01

I think you mean right in HTML4.01 for the latter part of the second
example. The example with /> is invalid HTML since that results in a 
greater than sign being inside the head element, and character data 
can't go there.

> In HTML specification the closing tag for br element is forbidden as 
> well, but according to the validator <br /> is a right HTML.

<br /> is valid HTML, but it doesn't mean what you'd expect. It means a 
br tag followed by a greater than sign. If you validate with the parse
tree option you should be able to get a clearer picture of what's going
on.



[1]: There might be some cases for very simple pages, but nothing
practical
Received on Friday, 28 January 2005 03:59:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:18 GMT