Forum Moderators: open

Message Too Old, No Replies

Trying to validate to XHTML 1.0 Strict

I copied the DTD from the W3C site but....

         

photon

2:17 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to validate to XHTML 1.0 Strict for the first time, using the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

I copied that from the W3C site, switching the

!DOCTYPE
and
?xml
lines as suggested by (I believe) Tedster in an earlier thread.

When I run through the validator at W3C I get the following:


I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to validate the document. The sources I tried are:
The HTTP Content-Type field.
The XML Declaration.
The HTML "META" element.
blah blah blah....

I had used the

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

statement earlier with no effect, and I can't find any similar statement in the source code at W3C.

What am I missing? Thanks for your help.

korkus2000

2:23 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try something like this

<?xml version="1.0" encoding="ISO-8859-1"?>
<!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">

with closing the meta like this

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

Gusgsm

2:49 pm on Feb 5, 2003 (gmt 0)

10+ Year Member



To me, this validated all right at the W3C as xhtml 1.1:

<?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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
<head>
<title>Whatever</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>

<p>This is a text.</p>

</body>
</html>

Can't remember now where did I get the ...http-equiv="content-type" content="application/xhtml+xml;... meta but there was some good info in the web about how to describe the content.

Ah! I found it: [w3.org...]

photon

4:24 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the replies korkus2000 and Gusgsm. I've discovered that if I put the?xml statement first it will validate (even without a meta tag). But I've read elsewhere in this forum that anything before the!DOCTYPE staement causes IE6 to go into quirks mode.

Any way to get validated code that IE6 interprets as strict?

andreasfriedrich

4:34 pm on Feb 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



photon [webmasterworld.com] wrote at 04:24 on Feb. 05, 2003 in message #4 [webmasterworld.com]
Any way to get validated code that IE6 interprets as strict?

The HTTP Content-Type field.

Andreas

photon

1:58 pm on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Andreas--

Are you talking about the meta tag?

andreasfriedrich

4:47 pm on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I´m talking about the HTTP response header field which may be used to specify the content type and encoding of the resource contained in the body of the HTTP message.


Content-Type: text/html; charset=ISO-8859-1

[faqs.org...] - 14.17 Content-Type

Andreas

photon

6:43 pm on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. I'll check out the link.