XML easy learning Manual (5) XML syntax 3

Source: Internet
Author: User
Chapter 4 XML syntax 5. Namespaces syntax Namespaces is translated into namespace. What is the role of namespace? When we apply another or multiple DTD files in an XML document, the conflict will be displayed: Because the XML identifiers create their own chapter 4 XML syntax.

V. Namespaces syntax

Translate Namespaces into namespace. What is the role of namespace? When we apply another or multiple DTD files in an XML document, it will present the conflict: Because the identifiers in XML are self-created, in different DTD files, the identifiers may have the same name but different meanings, which may cause Data confusion.
For example, in a document Wood table
Medium
Show tables,In another document
Namelist
Medium



Yourname is the namespaces name defined by you, and URL is the URL of the namespace.
Suppose the above 'table Performance table. If I need to process these two documents at the same time, a name conflict will occur.Knowing this title, we have introduced the namespaces concept. Namespaces identifies the same names by adding a URL to the ID.Namespaces must also be declared at the beginning of the XML document. the declared syntax is as follows:


Then apply the defined namespace in the following identifiers:
Wood table 'The document comes from the http://www.zhuozi.com and we can declare

In this way























XML
Ajie
Ajie@aolhoo.com
20010115
©Right;


Leave the zone. Note: setting a URL does not mean that the ID is actually to be read from that URL. it is only used as a different mark.6. entity syntaxEntity is translated as 'object '. Its function is similar to the 'macro 'in the word. it can also be understood as a dashboard in DW. you can define an entity in advance and then call it multiple times in a document, or call the same entity in multiple documents.Entity can contain characters, text, etc. the benefit of applying entity is: 1. it can reduce errors. you only need to enter multiple identical parts in the document. 2. it improves protection efficiency. For example, if you have 40 documents that contain the copyright entity, you only need to modify the originally defined entity statement if you need to modify this copyright without modifying all files.XML defines two types of entity. One is the common entity mentioned here, which is applied in the XML document; the other is the parameter entity, which is applied in the DTD file.The definition syntax of entity is: ]>For example, I want to define a piece of copyright information: ]>If the content of my copyright information shares an XML file with others, you can also apply the externally called method. The syntax is as follows: ]>The reference syntax of the defined entity in the document is: & entity-name;For example, the copyright information defined above is written during the call? Copyright;The complete example is as follows. you can copy and save it as a copyright. xml viewing instance: ]>

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.