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

Re: Bug in html validator re lack of title tag in XHTML 1.0 strict doc

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 08 Apr 2005 10:25:11 +1000
Message-ID: <4255CF67.9020701@lachy.id.au>
To: paul_lomax@ipcmedia.com
CC: www-validator@w3.org

paul_lomax@ipcmedia.com wrote:
> I've noticed that if you try and validate an XHTML 1.0 Strict html file,
> but miss out a 'title' tag,

You mean title *element*.  A tag refers only to the start-tag (eg. 
<title>) or end-tag (eg. </title>) of an element.
http://lachy.id.au/log/2004/12/html-tags

> rather than just say 'you are missing a title tag, they are required in
>  XHTML 1.0 Strict', it says:
>  
> Line 6, column 7: end tag for "head" which is not finished

Which is correct, even though it is somewhat confusing.  The reason is 
due to the way XML works.

An element starts with its start-tag (<head>) and ends with its end-tag 
(</head>), but if all required sub-elements do not occur within, the 
element itself is not finished.  However, despite the confusing error 
name, this case is described in the associated description:

> Another possibility is that you used an element (e.g. 'ul') which
> requires a child element (e.g. 'li') that you did not include. Hence the
> parent element is "not finished", not complete. 

In this case, this description still applies, although the elements in 
question are <head> and <title>, rather than <ul> and <li>

For the validator team:
Perhaps the error description could be updated to include a list of 
common elements for which this error occurs.

eg.
* head requires title
* ul and ol require li
* dl requies dt or dd
etc.

However, it seems to me as though it is far more common for a missing 
title to occur than a missing list item, so perhaps the example could at 
least be changed to reflect that.

-- 
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/     Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Received on Friday, 8 April 2005 00:25:19 GMT

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