Solved

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

Posted on 2008-09-30
7
226 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
  • 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now