PDA

View Full Version : XHTML validation problems


satyanaas
03-05-2003, 10:53 PM
I'm trying to break into XHTML and validating my sites. having trouble getting the W3C validator to recognize my site. I believe I have the DTD specified correctly but its not reading it. This is the page I'm trying to validate it up at http://www.maanik.com/

w3c tells me this :

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.


And I even tried to autodetect it using the algorithm defined in Appendix F of the XML 1.0 Recommendation.

Since none of these sources yielded any usable information, I will not be able to validate this document. Sorry. Please make sure you specify the character encoding in use.

Do I really need to specify the charcter encoding and how do I specify that, if that is my problem?

meow
03-05-2003, 10:58 PM
Yes, you do. On the server (.htaccess) or in a META tag or both.

BUT, for validation purposes you can use the Extended Interface which will let you choose an encoding from a drop-down. There's a link at the validator page. :p

satyanaas
03-05-2003, 11:10 PM
:confused:

thanks for replying...if it not too much trouble, could you give me an example of specifiying each?

thanks

meow
03-05-2003, 11:23 PM
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

If you can use an .htaccess file:
.............
AddType 'text/html; charset=ISO-8859-1' html
............

If you use the XML declaration you can also have it there.
http://www.w3.org/TR/2001/WD-xhtml1-20011004/#docconf

Change to the charset you want, of course. Read the bit about non unicode encoding at the URL above. It's very confusing. ;)

satyanaas
03-05-2003, 11:41 PM
:thumbsup:

thanks. I got the validation to work just selecting a encodign from there...I'll try specifying with the info you've given me...yeah, I tried reading up on special charcaters adn encoding at unicode.com but it makes about as much sense as a bunch od special characters to me right now...thanks again...

Alex Vincent
03-06-2003, 12:50 AM
FYI for XML documents in general, you can use the XML prolog to set the document encoding:

<?xml version="1.0" encoding="UTF-8" ?>

or

<?xml version="1.0" encoding="iso-8859-1"?>

Or whatever encoding is appropriate. :)

meow
03-06-2003, 12:55 AM
Yes, as said. But the problem with that is that it throws MS-stupid-IE6 into Quirks Mode. :(

Whatver additional methods are used I really think the character encoding should be sent in the HTTP headers first and above all, may it be XHTML or good old HTML.