[VE][64] Confusing error when title missing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[VE][64] Confusing error when title missing

Mellem, Dan
When validating:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<p> test

You get the error:
Error [64]: "document type does not allow element X here"

However, it would be clearer to report that the <title></title> section is missing or show [VE][73], but this is only shows if there's a "</head>."


Adding a title validates:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<title>a</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<p> test

Thanks,
-Dan



Reply | Threaded
Open this post in threaded view
|

Re: [VE][64] Confusing error when title missing

Jukka K. Korpela
2015-06-13, 3:53, Mellem, Dan wrote:

 > When validating:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
> <p> test
>
> You get the error:
> Error [64]: "document type does not allow element X here"

Specifically, “document type does not allow element "P" here”.

> However, it would be clearer to report that the <title></title> section is missing or show [VE][73], but this is only shows if there's a "</head>."

The lack of a TITLE element is indirectly reported: “"HEAD" not finished
but document ended”. This refers to TITLE, since it is the only required
child element of the HEAD element.

> Adding a title validates:

Yes.

Changing the validator to report explicitly about the lack of a TITLE
element would require a major change to its code, which now works
basically as an SGML validator (for HTML 4.01 validation), and when an
element is closed (perhaps implicitly as in this case), the validator
only knows whether the element was completed (contained all the required
children or not).

And most probably nobody is working the improvement of such validation
(ever); improvement efforts relate to HTML5 validation, which is
entirely different.

Yucca