www.webdeveloper.com
Results 1 to 4 of 4

Thread: Why doesn't this validate?

  1. #1
    Join Date
    May 2007
    Posts
    61

    Why doesn't this validate?

    Does anyone know why this doesn't validate?

    Code:
    <!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">
    It produces three validation errors:
    # Error Line 1, Column 108: DTD did not contain element declaration for document type name.

    .org/TR/xhtml1/DTD/xhtml1-strict.dtd">


    # Error Line 2, Column 66: document type does not allow element "html" here.

    tp://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

    # Error Line 62, Column 7: no document element.

    </html>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <!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" xml:lang="en" lang="en">
    http://www.w3.org/QA/2002/04/valid-dtd-list.html

  3. #3
    Join Date
    May 2007
    Posts
    61
    Case sensitive, I got it. Thanks, Fang!

  4. #4
    Join Date
    Dec 2012
    Posts
    1

    Post

    This is the error showing : DTD did not contain element declaration for document type name.

    Kindly check these 2 things n let me know what is wrong in the definitions....

    <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    and

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles