Wha is the function of xml:lang in the xml name space declaration?

What is the function of  xml:lang in xmlns declaration?

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html>
   
hallhillAsked:
Who is Participating?
 
Mark StegglesWeb DeveloperCommented:
Good question :)

According to the w3 you need both http://www.w3.org/TR/xhtml1/#C_7

xml:lang="en" is the xml version... which includes xhtml

lang="en" is html

Im not entirely sure why you need both... it may be because most sites use the text/html mime type and so browsers treat the xhtml as html.

Hope this helps

Steggs
0
 
Mark StegglesWeb DeveloperCommented:
Hello!

xml:lang="" sets the language of the contents of the element. It doesnt matter what element you add it to... it always has the same function

"Its purpose is to allow all different XML document types to use the same attribute for language identification."

http://www.opentag.com/xfaq_lang.htm#lang_xmllang

Thanks
Steggs
0
 
hallhillAuthor Commented:


Why xml:lang="en" lang="en"??

That is why I don't understand.Does it make a big difference if I don't include lang="en"??

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
hallhillAuthor Commented:

Steggs,

If I use xml:lang="en" lang="en", does the "Content-Type" have to "text/html" or "application/xhtml+xml"??

I just read read xml:lang attribute will take precedence over lang attribute.I understand that. Thanks for links.

But how about mime type??Which one I should use?I believe it has an effect over the search indexing.
Please clarify this matter.

Thanks in advance again
0
 
Mark StegglesWeb DeveloperCommented:
I have never heard or read that mime type effects search indexing.... where did you see that?

Use text/html as IE6 doesnt support application/xhtml+xml... and IE6 still has millions of users.
0
 
hallhillAuthor Commented:
Thank you very much!!!!
0
 
Mark StegglesWeb DeveloperCommented:
Thanks for the points and A grade. Take care
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.