Thursday, July 30, 2009

XML declaration above DOCTYPE?

What I mean is, should I include the line: "%26lt;?xml version="1.0" encoding="UTF-8"?%26gt;" at the very top of my web pages? Some pages are XHTML 1.0 compliant and some are valid for XHTML 1.1. Has anyone had a problem with or without this XML declaration line? Some examples I see ( http://www.w3.org/TR/xhtml1/#C_9 ) say to add the line if you can't set Content-Type on the webserver but some othere templates (like here: http://www.webstandards.org/learn/refere... ) don't use it.

XML declaration above DOCTYPE?
The XML declaration should definitly go before the DOCTYPE, if you want a strict validation.


If you see the page by webstandards.org, there is a validate link for XHTML,CSS at the bottom of the page. If you click the CSS link the resulting validator will report lots of errors, this means the webstandards does not follow strict standards. But they(webstandards) do give references to w3 in almost all their articles.





Conclusion XML declaration has to go before the DOCTYPE.





Njoy....
Reply:Nice comments and good research.... Helps a lot. Report It

Reply:When dealing with HTML code, there is never an absolute correct answer.


One server will play the %26gt;loop%26lt; while another misses the %26gt;tagline%26lt;





Welcome to the "inner circle..."

wreath

No comments:

Post a Comment