2nd day: What is namespaces _ Basic Tutorial

Source: Internet
Author: User
After the DOCTYPE is declared, the following code is:

Usually the code we HTML4.0 is just, what is the "xmlns" here?

This "xmlns" is an abbreviation for XHTML namespace, called the "namespace" declaration. What is the role of namespaces? Ateptsevo's own understanding is:

Because XML allows you to define your own identity, the identities you define may be the same as those defined by others, but they represent different meanings. Errors are easily generated when files are exchanged or shared. To avoid this error, XML uses namespace declarations, allowing you to identify your identity through a URL point. For example:

Xiao Wang and Xiao Li have defined an identity, if Xiao Wang's name space is "http://www.xiaowang.com", Xiao Li's namespace is "http://www.xiaoli.com", then when the two documents exchanged data, will not confuse the identity , because it belongs to different namespaces.

A more popular explanation is that namespaces are a sign of a document that tells people who the document belongs to. But this "who" used a URL instead.

XHTML is an identity language in which HTML transitions to XML, which need to conform to the rules of the XML document, and therefore also need to define namespaces. And because XHTML1.0 can not customize the identity, so its namespace is the same, that is, "http://www.w3.org/1999/xhtml". It doesn't matter if you don't understand it, we just need to copy the code at this stage.

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

  • Related Article

    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.