SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict dotancohen's Avatar
    Join Date
    Aug 2005
    Location
    Haifa
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML 4.01 Strict not parsing

    On http://dotancohen.com the pages aren't passing validation because of an apparent error in my content-type meta tag. I can't figure it out for the life of me. Does anybody see anything wrong with this code?

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
        <title>Dotan Cohen</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="dotan, cohen, israel, haifa, medic, golani, 51, terriblefile, terriblereferrer" />
        <meta name="description" content="If youre looking for Dotan Cohen, here I am. Dotan Cohens homepage." />
        <meta name="robots" content="index,follow" />
    
        <link rel="stylesheet" href="/eng/style.css" type="text/css" media="screen" />
    
    </head>
    <body>
    
    ....rest of page....
    . Have a question?
    . . What Is Firefox?
    . . . . What Is Open Office?
    . . . . . . What Is What?

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The problem is the /> at the end of the meta tags make it just > and it should validate.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The NET syntax is not allowed in HTML, but HTML has SHORTTAG YES in the SGML declaration, which means that the '/' character terminates the tag. That leaves the '>' character hanging, as character data. In other words, <meta/> is equivalent to <meta>&#38;gt;.

    Character data is not allowed in the HEAD element, which is why the validator complains.

    The only reason most purported XHTML documents don't show sprinkled '>' characters all over is because virtually all browsers have buggy parsers that simply ignore the '/' when parsing HTML.

    In real XHTML (served as XML), it's very different, of course.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Addict dotancohen's Avatar
    Join Date
    Aug 2005
    Location
    Haifa
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, the page was recently converted from XHTML. After reading some faqs here on sitepoint, I converted it to HTML 4.01. But I was getting the same parsing error on the page when it was XHTML as well.

    Also, the other meta tags don't throw the error.
    . Have a question?
    . . What Is Firefox?
    . . . . What Is Open Office?
    . . . . . . What Is What?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •