xml:lang versus lang
By Ramkumar Menon-Oracle on Sep 21, 2010
I was following an email thread when I hit this interesting link.
It talks about best practices while specifying language for content served on HTML/XHTML/XML pages.
"For HTML use the lang attribute only, for XHTML 1.0 served as text/html use the lang and xml:lang attributes, and for XHTML served as XML use the xml:lang attribute only."
2.XHTML served as text/html
<helloWorld lang="en-US" xml:lang="en-US"/>
3. XHTML served as xml
Browser understands only "lang" for text/html content.
Dont use "lang" with XHTML 1.1. Its not in the spec. [Its okay in 1.0]