
Lee Passey wrote:
The problem is, indeed, the unterminated comment. The XHTML DTD defines the <style> element as containing #PCDATA, which is to say textual 'stuff' which may or may not be HTML.
The problem cannot be the "unterminated comment" because the "comment" is no comment at all. Let's recap: File http://www.gutenberg.org/files/15698/15698-h/15698-h.htm has a doctype of <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> So lets take a look at the *HTML 4.01* specs (not the *XHTML* specs): <!ENTITY % StyleSheet "CDATA" -- style sheet data --> <!ELEMENT STYLE - - %StyleSheet -- style info --> The STYLE element contains CDATA, which is not parsed. In CDATA < has no special meaning at all and cannot therefore start a comment.
An HTML User Agent should _not_ attempt to parse any of the data between <style> and </style>, but should pass that text on to the stylesheet parser.
A user agent that *knows* about style sheets will not. A user agent developed before CSS will just ignore the style tags but will process the data in between.
While the lack of a closing comment tag in the <style> element is a bug in the document, the failure of your browser(s) to ignore comment tags in a <style> element is also a bug in those programs.
No bug. The program is simply to old and decrepit to know anything about style sheets. It skips the opening style tag (as it should as of the HTML standard before style sheets) and continues parsing, because it doesn't know about the contents of style being CDATA. It then finds an opening comment tag and that's all its gonna see for a long long time because the closing -- is found way down in the license.
Because the contents of a <style> element is #PCDATA, HTML validators will generally not be able to catch this type of error.
It is not! (People should really read the specs!) If it were #PCDATA (*Parsed* Character DATA) the validator would find the error because it would parse it. Its because its CDATA that the validator doesn't parse it and in consequence cannot find the "error". In CDATA < has no special meaning at all. -- Marcello Perathoner webmaster@gutenberg.org