1122Re: [jslint] no comments before html root element?
- Feb 9 2:15 PMOn Tue, Feb 9, 2010 at 1:02 PM, Cheney, Edward A SSG RES USAR USARC <
>HTML is not XML
>Right. But XHTML is an that's what I happen to be using. I was hoping that
JSLint could support my use of XHTML.
> and is processed as XML less than .0001% of the time across the web. AsRight. The XML recommendation doesn't allow comments before the XML
> such your comments regarding XML are irrelevant. Nowhere does the JSLint
> tool to claim to support or process XML in any form. Furthermore it is very
> bad practice to include comments prior to the initial XML processing
> declarations as this can quite likely interfere with XML processing when
> vocabularies from multiple separate definitions are included in a single XML
> instance. It is my recommendation that comments should not come before any
> XML processing declaration since the XML processing declarations always go
> at the top of the document.
declaration (not technically considered a processing instruction), but they
are allowed before processing instructions that appear in the prolog.
> It is not valid to include comments prior to the doctype declaration in aI think you are considering the XML declaration to be a kind of processing
> HTML 4 or XHTML1.x document. The specifications say nothing to this effect,
> but it should be presumed that processing declarations must be first
> explicitly in an HTML document, or in the case of XHTML the XML processing
> declarations must precede the SGML processing declarations.
instruction, but it isn't. You are correct that comments cannot proceed the
> Failure to comply results in altered rendering of the DOM in variousWhat if you don't have a DOCTYPE? JSLint doesn't allow comments before the
> different browsers, where such an alteration is contrary to standards
> compliance and cross browser conformity. In IE this phenomenon is defined as
> quirks mode and while most obvious to IE other browsers exhibit such
> behaviors less dramatically. As a result never include comments prior to the
> doctype. Compare the implications of such violations in your own testing.
root element html even if there is no DOCTYPE.
> Furthermore, it is bad practice to rely upon a source that may or may notIt seems that JSLint could be modified to allow comments that come after an
> differ from the language of the technologies' conformance specifications
> except where rules of best practice are concerned in the absence of
> specifics or conflict to standards language.
> Finally, browsers are sloppy. Everything in HTML processing is acceptable
> until its not, but that has absolutely no bearing on validity. That is why
> there are standards. Please do not confuse acceptability for validity.
XML declaration (if one is present) and perhaps after a DOCTYPE (if one is
present), but before the html tag. Are you saying that doing so causes
problems for a particular web browser?
R. Mark Volkmann
Object Computing, Inc.
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>