Forum Moderators: open
You should place a DOCTYPE declaration as the very first thing in your HTML document. For example, for a typical XHTML 1.0 document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Title</title>
</head>
<body>
<!-- ... body of document ... -->
</body>
</html>
[w3.org...]
I've actually had the experience of comparing the DTD in my document character for character with the ones on this page, finding an exact match, and still not having it work. However, if I copy and paste from the w3c page into my document and delete the old (seemingly identical) DTD, things work. My best guess is that there was a character set issue. I haven't checked with a hex editor. Next time, I think I will.
Whoops - forgot to add a <title> tag. Now it works - both mine and yours.
[edited by: lorax at 5:49 pm (utc) on Dec. 30, 2002]
Fatal Error: No DOCTYPE specified!
I could not parse this document, because it does not include a DOCTYPE Declaration. A DOCTYPE Declaration is mandatory for most current markup languages and without such a declaration it is impossible to validate this document.
You should place a DOCTYPE declaration as the very first thing in your HTML document. For example, for a typical XHTML 1.0 document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Title</title>
</head>
<body>
<!-- ... body of document ... -->
</body>
</html>
<!-- FileName="Connection_cf_dsn.htm" "" -->
<!-- Type="ADO" -->
<!-- Catalog="" -->
<!-- Schema="" -->
<!-- HTTP="false" -->
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>New and Used Packaging Equipment-MAVPAC Equipment</title>
The next step is to correct the remaining errors. Again, start with the first one on the page, because some of the ones further down the page might in fact just be side-effects of the first one.
<added>And of course, if you wrote valid HTML it is entirely possible that using an HTML DTD instead of one for XHTML would be enough. If so, Lorax's solution would work just fine.<added>
That means you are better off now than you were before.
Agreed! The whole point of validation is to ensure you're code is compliant with the guidelines as set forth by W3C. The Validator is simply telling you what it found that doesn't comply.
Don't get discouraged. Often times you'll find that fixing one thing will remove 2 or 3 errors from the validator. Work through them one at a time and check the page after each change.
This page is not Valid HTML 4.01 Transitional!
Below are the results of attempting to parse this document with an SGML parser.
Line 26, column 50: required attribute "TYPE" not specified (explain...).
<script language="JavaScript1.2" src="/mm_menu.js"></script>
[w3.org...]
The short answer is you need to add the type attribute to the <script> element: type="text/javascript"