XML technology (1)

zhaozj2021-02-16  47

I. Introduction to XML

Lift XML (Extensible Markup Language Extended Markup Language), I believe that the industry will not be unfamiliar, as a computer technology is just a few years, with its simpleness.

Let's take a simple example:

Nige RESS

Sayings of the Century </ Title></p> <p></ book></p> <p><book category = "fiction"></p> <p><author> Evelyn Waugh </ author></p> <p><title> Sword of Honour </ Title></p> <p></ book></p> <p></ books></p> <p>From the data from the above image, we can see that such simple data, clearly describes the information of two books, including the type of book, the author, and title. Since XML can be understood as a formatted text, for XML, there is no operating system concept, as long as it supports text processing machine, you can get the required data from XML, and, with general text Different, XML itself has a certain data structure, with techniques to read XML format documents (such as traditional SAX (Simple API for XML), and DOM (DOCUMENT OBJECT Model) parsers, including later introduced Support for XML in .NET, it is convenient and quick to quickly process data in XML.</p> <p>XML itself does not have much grammar requirements, as long as the mark corresponds to one or one, it is not nested. In addition, in order to meet some requirements for the integrity and security of the data itself, some related techniques such as DTD (Document Type Decation Document Object Model), XDR (XML Data Reduced), and XSD (XML Mode Definition Language) can be XML provides valid validation to ensure integrity of data in XML.</p> <p>Second, XML technology in .NET</p> <p>.NET as a new generation of development models launched by Microsoft, providing extremely perfect support for XML. It can be said that .NET does not provide support for XML, and its core is also closely combined with XML. We can take a look at the following aspects:</p> <p>1, traditional analysis</p> <p>Like other programming languages, .NET provides a very complete class library to support XML in the .NET (including C #, VB.NET, Host C , etc.) to write to XML. The program of reading and writing.</p> <p>Note: These classes are located under System.xml Namespace, supports the XML document with SAX mode and DOM mode.</p> <p>2, advanced analysis of the .NET</p> <p>In addition to supporting traditional parsing methods, some techniques in .NET are also supported to parse XML data, such as the widely used DataSet in ADO.NET (data set stores data in disconnects. Data set Structure is similar to the structure of the relational database; it publics the layered object model of the table, rows and columns. In addition, it is constrained and relationship defined by the data set. It can be understood as a form of expression in the database), READXML (read XML architecture and data into dataset) and getXML (return to XML representation stored in DataSet.) And WRITEXML (from DataSet write XML data, you can also choose a write architecture.) Method for parsing XML . By using these methods, it can be effectively interacting with XML data in .NET.</p> <p>3, XML verification</p> <p>As mentioned earlier, there are now three ways to verify the XML: DTD, XDR mode and XSD mode. In .NET, it provides support for these three ways, where XSD (W3C Developed XML Mode Definition Language) mode, .NET Framework provides a wide range of support.</p> <p>Of course, this does not mean that DTD and XDR mode are inconsistent with .NET Framework, in VS.NET contains some tools, these tools can help us convert XDR mode to XSD format.</p> <p>Since the XSD standard is very long and complicated, as a widely supported standard in .NET Framework, VS.NET provides us with several tools that are easy to create an XSD mode, and we can optionally create the required XSD mode. :</p> <p>1) Use XML Designer from the beginning to create a time;</p> <p>2) Use Server Exploreer to create from a database;</p> <p>3) Create from an XML document or XDR mode using XSD Generator;</p> <p>In addition, the XSD mode also follows XML syntax, so we can also use Microsoft SOM (Schema Object Model Mode Object Model) to modify SOM object tree in memory, and write this mode to disk file to achieve dynamic modification The purpose of XSD mode.</p> <p>4, XML serialization</p> <p>Of course, the role of XML is not allowed. When a distributed system is created, a portion that must be resolved will get a portion of the system to another to another.</p> <p>In order to meet this demand, .NET Framework implements an XML-based serial mechanism that you can serialize an object to an XML format, so that all public domains and properties will be written in XML format. Then you can send this XML data to anywhere you want, because XML is an open, waited for a widely supported standard.</p> <p>At the same time, the XML data can be paid in the receiving end application, so that the object can be reconstructed in memory.</p> <p>5, configuration in .NET</p> <p>The above introduction to some general technologies used in .NET Framework, in fact, .NET itself is also related to XML interest, extensive use of XML in .NET Framework, using XML for application configuration.</p> <p>There are three kinds of three:</p> <p>1) Application configuration file</p> <p>Such profiles indicate settings for a separate application, bind to information on the assembly, and the configuration of the remote object, etc. For example, an application is a standard .exe application, then the application's file name plus one .config extension.</p> <p>For the web application of ASP.NET, the cultivated details will be stored in a file called web.config. A server can have multiple web.config files, each of the web.config files exists in the root of the application or in their subdirectory. 2) Machine or server profile</p> <p>This is an XML file called Machine.config for system-wide configuration.</p> <p>3) Security profile</p> <p>This type of configuration file is used by the Framework security system to determine what license is received. A total of three configurable policy levels: enterprise-class, machine-level and support levels.</p> <p>To read or modify these configuration information, you can use any standard text editor, an XML analyzer, or you can read the API of the configuration file and extended configuration files in a set of users provided in the .NET Framework.</p> <p>Third, the future of XML technology</p> <p>Although the use of XML technology has made many fields, the superiority of XML technology determines that it is inevitably used in more fields, such as in the next generation of database techniques, the XML database will appear, this database is different from now Some relationship databases can allow different amounts of information contained in the data of the same class.</p> <p>For example, a library data, the hypothesis has 2 books, I hope to save the title, author, publishing house, price, and page number information, according to the existing relational database, possible storage mode:</p> <p>Name</p> <p>Author</p> <p>Publish</p> <p>PRICE</p> <p>Pageno</p> <p>1</p> <p>.NET XML advanced programming</p> <p>Wrox</p> <p>Tsinghua University Press</p> <p>75</p> <p>676</p> <p>2</p> <p>XML advanced programming</p> <p>Wrox</p> <p>Mechanical Industry Press</p> <p>95</p> <p>944</p> <p>If one of them I hope to save the title, author, publishing house, price, and page number information, and another one I only want to save the title, the author, and price information.</p> <p>According to the existing relational database, the possible storage mode is:</p> <p>Name</p> <p>Author</p> <p>Publish</p> <p>PRICE</p> <p>Pageno</p> <p>1</p> <p>.NET XML advanced programming</p> <p>Wrox</p> <p>Tsinghua University Press</p> <p>75</p> <p>676</p> <p>2</p> <p>XML advanced programming</p> <p>Wrox</p> <p>NULL</p> <p>95</p> <p>NULL</p> <p>From the above figure we can see that there is no valid value in the second row of data in the existing relational database, but there is no valid value, but still use null to indicate certain data resources.</p> <p>Now, let's take a look at how to use XML to represent this information:</p> <p>First case: second case</p> <p><? XML Version = "1.0"?></p> <p><books></p> <p><book></p> <p><Name> .NET XML Advanced Programming </ Name></p> <p><author> Wrox </ author></p> <p><Publish> Tsinghua University Press </ public></p> <p><Price> 75 </ price></p> <p><Pageno> 676 </ PAGENO></p> <p></ book></p> <p><book></p> <p><Name> XML Advanced Programming </ Name></p> <p><author> WORX </ author>></p> <p><Publish> Machinery Press </ public></p> <p><price> 95 </ price></p> <p><Pageno> 944 </ PAGENO></p> <p></ book></p> <p></ books></p> <p><? XML Version = "1.0"?></p> <p><books></p> <p><book></p> <p><Name> .NET XML Advanced Programming </ Name></p> <p><author> Wrox </ author></p> <p><Publish> Tsinghua University Press </ public></p> <p><Price> 75 </ price></p> <p><Pageno> 676 </ PAGENO></p> <p></ book></p> <p><book></p> <p><Name> XML Advanced Programming </ Name></p> <p><author> WORX </ author> <price> 95 </ price> </ book> </ books></p> <p>From these two figures, we can see the use of XML description data, which provides the information we need, but in the second case, there is no information that does not need.</p> <p>Of course, here is just a little advantage that uses this XML to save data. It is necessary to apply it to the database processing technology. However, Microsoft is already doing this, let us wait .</p> <p>In addition, as a big direction in the future application of XML technology --XML Web Services is also unable to mention, the name is on the name, this technology and XML are closely tight. To use the web service is inseparable from XML, from WSDL ( Web service descriptive language) to SOAP (Simple Object Access Protocol) is described using XML.</p> <p>However, based on Web service security, the major industry giants are currently developing a Web service-based security protocol, which is believed that Web Services will also be quite widely used in the near future.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-28175.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="28175" 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.056</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 = 'Iy6f5I5o_2BPFY9dDtKIBa8JeqMR1TBCLb1eBdNRH8AO7iGT18eyBjyHrfrD2eUYnvY1c0fa2D_2Fr0ngsz_2BPo2xaA_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>