Will not accept DOCTYPE statement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Will not accept DOCTYPE statement

Ray Devore
In checking the Family page below, I get an error stating "DTD did not contain element declaration for document type name"

I am using the following DOCTYPE statement:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
          "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
coppies directly from W3C QA - Recommended list of Doctype declarations you can use in your Web document

 
 
image
 
 
 
 
 
Family
This page is for Family
Preview by Yahoo
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Philip Taylor (Webmaster, Ret'd)


Ray Devore wrote:

> In checking the Family page below,

> <!-- Default Geneology Page -->
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


Suggest removing the leading comment and blank line, and making the
DOCTYPE directive the first line of the file.

Philip Taylor

Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Ray Devore
That is how I had it to begin with. I changed it back to that and am still getting the error.


On Sunday, September 21, 2014 4:36 AM, Philip Taylor <[hidden email]> wrote:




Ray Devore wrote:

> In checking the Family page below,

> <!-- Default Geneology Page -->

>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>           "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
">


Suggest removing the leading comment and blank line, and making the
DOCTYPE directive the first line of the file.

Philip Taylor



Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Steve Faulkner-2
what is the error?

--

Regards

SteveF
HTML 5.1

On 21 September 2014 10:41, Ray Devore <[hidden email]> wrote:
That is how I had it to begin with. I changed it back to that and am still getting the error.


On Sunday, September 21, 2014 4:36 AM, Philip Taylor <[hidden email]> wrote:




Ray Devore wrote:

> In checking the Family page below,

> <!-- Default Geneology Page -->

>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>           "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
">


Suggest removing the leading comment and blank line, and making the
DOCTYPE directive the first line of the file.

Philip Taylor




Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Philip Taylor (Webmaster, Ret'd)


Steve Faulkner wrote:

> what is the error?

Line 2, Column 51: DTD did not contain element declaration for document
type name

                  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

DOCTYPE directive reads :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
                  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

W3C recommend :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Could the missing <?xml version="1.0" encoding="UTF-8"?> account for the
error ?

Philip Taylor

Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Jukka K. Korpela
In reply to this post by Philip Taylor (Webmaster, Ret'd)
2014-09-21 12:36, Philip Taylor wrote:

>> <!-- Default Geneology Page -->
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN"
>>  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>
>
> Suggest removing the leading comment and blank line, and making the
> DOCTYPE directive the first line of the file.

That’s advisable indeed, but it does not affect validation. Validators
have no problems with such a comment, as it is permitted by the syntax.
But some old browsers (while consuming XHTML as old HTML tag soup) will
go to Quirks Mode if the DOCTYPE string is preceded by anything.

Yucca



Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Jukka K. Korpela
In reply to this post by Steve Faulkner-2
2014-09-21 12:59, Steve Faulkner wrote:

> what is the error?

The error message was “DTD did not contain element declaration for
document type name”. (I had to look it up in the archives, as I did not
see the original message in the list, for some reason.)

The problem with the page,
http://cis.sac.alamo.edu/~rdevore/mfc/default.shtml
is just that the DOCTYPE declaration contains “HTML” in upper case. It
must be

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

The reason is that XHTML is case-sensitive with element names, so the
DOCTYPE declares the root element as “HTML”, but no such element is
defined in the DTD.

Yucca


Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Steve Faulkner-2
In reply to this post by Steve Faulkner-2

On 21 September 2014 15:05, Ray Devore <[hidden email]> wrote:
The error states "DTD did not contain element declaration for document type name"

right and if you lower case HTML = html the error goes away

--

Regards

SteveF
HTML 5.1
Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

Ray Devore
Steve,

You are my hero. That did it. I have that same problem on multiple pages, so now I can fix them all. Any idea as to why it likes lower case, but not upper case?

Ray


On Sunday, September 21, 2014 9:12 AM, Steve Faulkner <[hidden email]> wrote:



On 21 September 2014 15:05, Ray Devore <[hidden email]> wrote:
The error states "DTD did not contain element declaration for document type name"

right and if you lower case HTML = html the error goes away


--

Regards

SteveF
HTML 5.1


Reply | Threaded
Open this post in threaded view
|

Re: Will not accept DOCTYPE statement

David Dorward-3
On 22 Sep 2014, at 1:02, Ray Devore wrote:

> You are my hero. That did it. I have that same problem on multiple pages, so now I can fix them all. Any idea as to why it likes lower case, but not upper case?

XML is case sensitive, <html> is not <HTML> and the Doctype has to specify the type of the root element.

--
David Dorward
http://dorward.co.uk/

signature.asc (900 bytes) Download Attachment