The birth of XML

zhaozj2021-02-17  72

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 ---- The standard XML documentation about the student flower roster information is this: ---- Student .XML 001 Zhang 3 male Beijing 1980 3 1 002 Female Hebei Province 1979 5 12 ---- Now we have a style list to describe it:

---- MyStyle.xsl Student Relief </ Title> </ head> <body> <xsl: Apply-Templates Select =" Student Relief "/> </ body> </ html> </ XSL: Template> <XSL: Template Match = "Student Relief"> <XSL: for-Each Select = "Students"> <UL> <li> <XSL: Value-of SELECT = "Name" /> </ li > <Ul> <li> Learn: <XSL: Value-of SELECT = "Learn" /> </ li> <li> Gender: <XSL: Value-of SELECT = "Sex" /> </ li> <Li> born: <xsl: value-of select = "born" /> </ li> <li> birth year: <xsl: value-of select = "Birth Date / Year" /> </ li> <li > Birth month: <XSL: Value-of select = "Birth Date / Month" /> </ li> <li> birthday: <xsl: value-of select = "Birth Date / Day" /> </ li> </ Ul> </ ul> </ xsl: for-each> </ xsl: template> </ xsl: styleSheet> ---- The display result of the XML file seen in IE5 is like this: L Zhang 3 M LCO: 001 M Gender: Male M Birth: Beijing M Birth Year: 1980 M Birth Month: 3 M Birthday: 1 L Li Si M Study: 002 M Gender: Female M Birth: Hebei Province M Birth: 1979 M Birth Month: 5m birthday: 12 ---- Interested readers can use the "Notepad" to enter the three files above, and put on a directory after the disk, then use IE5 to open the file. STUDENT.XML, see if the result is like this.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-31248.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="31248" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.046</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'aJwL3ExQGfPWeb7Djo_2FFKJMz4HYKvcAHgt32f1ItBQIsW9dZCjs4iO_2BvaIh6gM31Yveqn4yOdtxS9wgxkZI1jw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>