Solved

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

Posted on 2008-09-30
7
235 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:Steggs
Steggs earned 500 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:
Steggs earned 500 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
Independent Software Vendors: 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:Steggs
Steggs earned 500 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:Steggs
ID: 22623544
Thanks for the points and A grade. Take care
0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Secure Connection Failed - Sonicwall FW 1 106
Google Chrome crashing when selecting Dell Printer 15 69
Grunt script for Build Process 1 67
Code Coverage and Coding Standards 2 52
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

730 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