• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

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>
   
0
hallhill
Asked:
hallhill
  • 4
  • 3
3 Solutions
 
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
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now