Results 1 to 4 of 4
Thread: HTML 4.01 Strict not parsing
Mar 16, 2007, 09:44 #1
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?
<!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....
Mar 16, 2007, 09:49 #2
The problem is the /> at the end of the meta tags make it just > and it should validate.
Mar 16, 2007, 11:00 #3
- Join Date
- Nov 2004
- 0 Post(s)
- 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>&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
Mar 17, 2007, 01:43 #4
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.