XHTML Day 2nd: What is a name space

Source: Internet
Author: User
Tags define xmlns
xhtml| name Space

After the DOCTYPE is declared good, the next code is:

Usually our html4.0 code is just , what's "xmlns" here?

This "xmlns" is an abbreviation of the XHTML namespace, called a "namespace" declaration. What is the role of the name space? Atzie's own understanding is:

Since XML allows you to define your own identity, the identity you define may be the same as the one defined by others, but it means different meanings. Errors can easily occur when files are exchanged or shared. To avoid this error, XML uses the namespace declaration, which allows you to identify your identity by pointing to a URL. For example:

Xiao Wang and Xiao Li both defined a logo, if Xiao Wang's name space is "http://www.xiaowang.com", Xiao Li's name space is "http://www.xiaoli.com", then when two documents Exchange data, Nor does it confuse identity, because it belongs to a different name space.

The more popular explanation is that the name space is to make a mark on the document, tell others, this document belongs to WHO. But this "who" uses a URL to replace.

XHTML is an identity language that HTML transitions to XML, and it needs to conform to the rules of XML documents, so it also needs to define namespaces. And because xhtml1.0 cannot customize the identity, it has the same name space, which is "http://www.w3.org/1999/xhtml". If you do not understand it does not matter, at this stage we just copy the code can be.

After the lang= "gb2312", specify your document in Simplified Chinese.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.