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

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 UTC