Glom Posted October 10, 2006 Share Posted October 10, 2006 I noticed there is a XHTML 1.1 and I tried to get one of the pages of my site validated under it. This page had been validated with XHTML 1.0. There was only one complaint.It didn't like the use of the lang attribute in my first html tag. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> How important is lang? Is there something new to replace it for XHTML 1.1? Link to comment Share on other sites More sharing options...
kaitco Posted October 12, 2006 Share Posted October 12, 2006 Just use xml:lang. It is explained a little more here: http://www.w3.org/TR/xhtml11/changes.html Link to comment Share on other sites More sharing options...
Glom Posted October 12, 2006 Author Share Posted October 12, 2006 Thanks. Link to comment Share on other sites More sharing options...
croatiankid Posted October 16, 2006 Share Posted October 16, 2006 don't forget to use <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> , which will probably break in IE! otherwise, with content="text/html; web browsers treat you page as html, not xhtml. And not only dose it treat it as html but as tag soup (html 3.2 or random html junk) because you have an invalid html doc type. This can have unpredictable results in how the page is displayed. Link to comment Share on other sites More sharing options...
aspnetguy Posted October 16, 2006 Share Posted October 16, 2006 I would recommend using conditional comments so you can use application/xhtml+xml for everything except IE Link to comment Share on other sites More sharing options...
boen_robot Posted October 17, 2006 Share Posted October 17, 2006 Changing the <meta> is not what will break IE, nor is what will change the MIME type. Try it if you don't believe me. What will break IE and what is the correct way of serving XHTML is to set the server to serve files with that MIME type. In Apache's configuration file, this might look like: AddType application/xhtml+xml .html In order to enable this MIME type for every user agent that supports it and use text/html only for IE and other user agents that don't support this MIME type, you need server side scripting.In this topic GT500 shows a simple PHP script to switch between the two and even the DTD if needed. I do reccomend not changing the DTD though. Trying to handle a single piece of code across two MIME types and IE on top is enough trouble as it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now