Loading ...
Sorry, an error occurred while loading the content.

1127Re: [jslint] no comments before html root element?

Expand Messages
  • Mark Volkmann
    Feb 10, 2010
    • 0 Attachment
      On Tue, Feb 9, 2010 at 11:23 PM, Cheney, Edward A SSG RES USAR USARC
      <austin.cheney@...> wrote:
      >
      >
      >
      > Any tag that is delimited as <?xml is an XML processing declaration. Several such declarations may occur in an XML document and preceed schema validation.

      Maybe I can learn something new here. Can you point me to a
      description of the term "XML processing declaration"? It is my
      understanding that there are "XML declarations" and "processing
      instructions" and that an "XML declaration" is not considered to be a
      kind of "processing instruction" even though they have the same
      syntax. There are two reasons why I think this distinction is
      important. First, when the DOM Document getProcessingInstructions
      method is called, it will not return the XML declaration. Second, the
      recommendation says that comments cannot proceed the XML declaration,
      but can proceed processing instructions.
      I understand that HTML is not XML, but are you aware of a specific web
      browser that doesn't honor the distinction between XML declarations
      and processing instructions that is made in the XML recommendation?

      > > What if you don't have a DOCTYPE?
      > The default rendering is quirks mode and user agents do the best they can to guess at the rendering model and DOM, but that guessing opens wild variance that defeats cross browser conformity. Absense of a doctype destroys standards compliance back until HTML 2, which predates the standardized specification of the DOM. In accordance with the standards the doctype declaration is required since HTML 3 and HTML 3.2.
      > > JSLint doesn't allow comments before the root element html even if there is no DOCTYPE.
      > JSLint is enforcing a good practice. I urge you to follow it.
      >
      > Why would you want to suggest a change to JSLint in favor of a practice that exposes considerable costs and risks to management of HTML documents?

      I agree that JSLint shouldn't be changed to allow something that
      causes a problem for one of the major browsers.

      Can you tell me if one of the major browsers would have a problem with
      the following?

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <!-- some comment -->
      <html>
        <head>
          <title>some title</title>
        </head>
        <body>
        </body>
      </html>

      --
      R. Mark Volkmann
      Object Computing, Inc.
    • Show all 22 messages in this topic