Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-09-30
7
Medium Priority
?
243 Views
Last Modified: 2013-11-19
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
Comment
Question by:hallhill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 30

Assisted Solution

by:Mark Steggles
Mark Steggles earned 2000 total points
ID: 22622757
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
 

Author Comment

by:hallhill
ID: 22622819


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
 
LVL 30

Accepted Solution

by:
Mark Steggles earned 2000 total points
ID: 22622959
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:hallhill
ID: 22623325

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
 
LVL 30

Assisted Solution

by:Mark Steggles
Mark Steggles earned 2000 total points
ID: 22623434
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
 

Author Comment

by:hallhill
ID: 22623537
Thank you very much!!!!
0
 
LVL 30

Expert Comment

by:Mark Steggles
ID: 22623544
Thanks for the points and A grade. Take care
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question