First, let's review the development brief history of Extensible Markup Language.
---- XML has two pioneers - SGML and HTML, both of which are very successful marking languages, but they all have innate defects in some respects. The full name of SGML (Standard Generalized Markup Language is a standard universal set language that provides an abnormal power tool for syntax, which is excellent, so it is very useful in classification and index data. However, SGML is very complicated, and it is expensive. Several major browser manufacturers have clearly refused to support SGML, so that SGML has encountered great obstacles online.
---- Instead, hypertext marking language HTML (Hypertext Markup Language) is free, simple, widely used worldwide applications. It focuses on the description of the home page expression, greatly enriches the visual and auditory effect of the homepage, in order to promote the booming of WWW, the online exchange of information and knowledge will play an unsubstituted role. However, HTML also has the following fatal weaknesses, which gradually became an obstacle to HTML to continue to develop applications.
HTML is designed to describe the form of performance of the home page, which is negligible to describe the information semantics and its internal structure, and cannot adapt to increasing information retrieval requirements and archive requirements. HTML's description ability is actually very insufficient, it cannot describe vector graphics, scientific symbols, and some other special display effects. The HTML marker set is increasingly bloated, and its loose grammar requires the confusing of the document structure and lacks organization, leading to the design of the browser to be increasing, reducing the time efficiency and space efficiency of the browsing.
---- For this reason, in 1996, people began to describe a marking language that has both SGML power and scalability, while also HTML simplicity. XML is born like this. --- Like SGML and HTML, the extensible grouping language XML is also a marking language that describes structured data by adding additional information in the data. However, XML is not like HTML, only one set of prior defined tags have been provided. Quantitatively, it is a dollar label language that allows program developers to develop a variety of bursary languages based on the rules it provides. In XML, the syntax of the marking is to describe the document type definition DTD (Document Type DEFINITION), that is, what is a valid tag, and further defines the structure of the marking language. In addition to defining the syntax of the assignment, in order to clarify the meaning of each tag, XML also uses the style sheets connected to the application, such as a browser, and provides an instructions for processing the display. When a word is covered, the XML is to describe data by data documentation, DTD, and style single three separation portions. ---- Although XML looks like complex, it has some prominent advantages: ---- 1. Good scalability. XML allows all different industries to develop their own set of tags according to their own unique needs. At the same time, it does not require all browsers to handle these thousands of tags, and they do not require a marking language to be suitable for various industries. Applications in various fields, the method of specific analysis of specific issues is more conducive to the development of the language. ---- 2. Separation of content and form. As mentioned earlier, the display mode of information in XML has been drawn from the information itself, placed in "style sheet". This makes it easy for the information expressions to make the data search, which also makes XML have good self-description, and the relationship between the information itself can be described. ---- 3. Follow strict grammar requirements. XML not only requires label matching, nested, but also requires strict compliance with DTD regulations. This increases the readability and maintainability of the webpage document, which greatly reduces the burden on the browser developer and improves the time space efficiency of the browser. ---- 4. Easy to transfer information between different systems. Different companies, there are often many different systems in different departments, and XML can be used as a communication medium between various systems, which is an ideal Internet language. ---- 5. Has good preservation. XML's preserves come from one of its pioneers - Sgml language, which can provide a document with more than 50 years of life. ---- For these advantages, the International Standardization Organization-World Wide Web Consortium recommended XML as a second-generation web publish language. ---- Finally, let's take a complete XML example in order to have a general understanding of the overall mechanism of XML. In the following example, we use XML to describe a list of information about a student script. Let's define a DTD for these data:
---- stump.dtd XML Version = "1.0" encoding = "gb2312"?> ---- The standard XML documentation about the student flower roster information is this: ---- Student .XML XML version = "1.0" encoding = "gb2312" standalone = "no"?> xml-stylesheet type = "TEXT / XSL" href = " ">
---- MyStyle.xsl XML Version = "1.0" encoding = "GB2312"?>