XML Easy Learning Manual (2) XML Concept

xiaoxiao2021-03-06  105

Chapter II XML Concept

preface

After the first chapter, you already know that XML is a language that makes you create a logo, it can separate data from the format from the web page, which can store data and sharing data characteristics make XML No. If you want to learn XML in-depth, the system masters the XML of the dragon, then we must first return to the XML concept. XML (Extensible Markup Language), an extensibility identifier language. "Scalability" "Identify" "Language". Each word is clearly clearly important and features of XML. Let's take care of:

I. Extensibility II. Identifier III. Structured Five. Meta Data 6. Display Seven. DOM

1. Scalability --- Use XML, you can build your own tag (tags) for your document.

The first word of XML is "scalability", which is why XML powerful features and flexibility. In HTML, there are many fixed tags, we must remember and use them, you can't use tags that have not been in the HTML specification. In XML, you can build any tags you need. You can give full play to your imagination and give your document. Some good marker names. For example, your document contains some game Raiders, you can build a tag called , then build , and other tags according to the game category under . As long as clear, it is easy to understand that you can build any number of tags.

At the beginning, you may not be adapted, because when we learn HTML, there is a fixed tag to learn and use directly; (Many people include I have to analyze the code and identification of others, and build their own webpage), and XML But there is no mark to learn, and there are very little marks for the documentation. what should we do? Oh, I didn't create it myself. Once you really start writing an XML document, you will find that the new tag that you want to create is also a very interesting thing. You can build a mark with your own characteristics and even build your own HTML language.

Scalability allows you to have more choices and powerful capabilities, but also generate a problem is that you must learn to plan. You have to understand your own document, know what part of it consists, and how to identify them.

Regarding the establishment of the logo, it is also necessary to explain that the identifier is the type or feature of describing the data, such as , age , Name <10pxl>, <18>, <10pxl>, <18>, <10pxl>, <18> Zhang San>, these are all useless tags. If you have learned a database, you can understand this, identify is a field name.

II. Identification --- Use XML you can identify the elements in the document.

The second word of XML is "identified", indicating that the purpose of XML is to identify elements in the document.

Whether you are html, or XML, the nature of the identity is to understand, if there is no logo, your document seems to be a very long string in the computer, each word looks the same, no focus.

By identifying, your document is easy to read and understand, you can divide the paragraph, list the title. In XML, you can use its scalability to create a more appropriate identifier for documents.

However, there is a little to remind everyone to pay attention: Identifier is just to identify information, it does not convey information. For example, this HTML code:

frist step represents bold, only to illustrate the "frist step" character with bold, does not contain any actual information, you can't see it on the page To , true conveyance information is "frist step". Three. Language --- Use XML you have to follow a specific syntax to identify your document.

XML third word is "language". This indicates that a certain rule must be followed as a language XML. Although XML scalability allows you to create new identities, it still must follow specific structures, grammar, and clear definitions.

In the computer field, language often represents a "quot; program language", used to program some features and applications, but not all "language" is used to program, XML is just a kind of identity and description information. language.

Let's take a deep understanding of the principles of XML applications, it may be very boring, but for the overall understanding, you can quickly pass it first, there is a vague concept in my heart, and the essence is slowly understanding. .

IV. Structured --- XML ​​prompts document structured, all information is arranged in a certain relationship.

"Structured" sounds too abstract, we understand that structure is to establish a framework for your document, just write an outline first. Structured makes your document don't make messy, each part is closely linked to form a whole.

Structured has two principles: 1. Each portion (each element) is associated with other elements. The associated series has formed a structure. 2. Identify the meaning of itself separated from the information it described.

Let's take a simple example help understand: XML Easy Learning Manual </ title> <chapter> XML Quick Start <PARA> What is XML </ Para> <Para> The benefits of using XML </ Para> </ chapter> <Chapter> XML concept <Para> Scalability </ Para> <Para> Identifier </ Para> </ Chapter> </ MyFile > This is the XML description document in this article, you can see the identification division three levels, very clear: <myfile> <chapter> <para> ... </ para> </ chapter> </ myfile> The above document structure We also call it "document tree", the main is the parent element, such as <myfile>, branches and pages are child elements, such as <chapter> and <para>.</p> <p>5. Metadata - Professional XML users use META data to work.</p> <p>In HTML, we know that you can use the META ID to define keywords, introductions, etc. of the web page, which are not displayed in the web, but can be searched by the search engine and affect the order of the search results.</p> <p>XML deepens and extension this principle, with XML, you can describe where your information is, you can verify the information through Meta, perform search, force display, or processing other data.</p> <p>Here is the use of some XML metadata in practical applications:</p> <p>1. You can verify that the digital signature is valid for the submission movement of online business. 2. Can be easily established indexing and more efficient search. 3. You can transfer data between different languages. W3C organization is studying a Metadata processing method called RDF (Resource Description Framework), which can be automatically exchanged information, W3C claims that using RDF with digital signatures, will make the "real credible" e-commerce.</p> <p>6. Display</p> <p>The page cannot be displayed separately, we use formatted technology, such as CSS or XSL, to display the document created by XML tags.</p> <p>In the first chapter, the XML is separated by data and format. The XML document itself does not know how to display, must have auxiliary file to help implement. (XML cancels all identifiers, including Font, Color, P or other style definition identifier, so XML is all ways to use the CSS in DHTML to define document style styles.), XML used to set file types of display style styles Have:</p> <p>1.xsl</p> <p>The XSL is full name is Extensible Stylesheet Language (Extensible Styles), which is the main file type of XML document display style. It itself is also based on XML language. With XSL, you can set up document display styles, and the document will automatically adapt to any browser and PDA (handheld).</p> <p>XSL can also convert XML to HTML, so old browsers can also browse XML documents.</p> <p>2.CSS</p> <p>CSS is very familiar, the full name is the Cascading Style Sheets, which is currently used to display the main way of the XML document on the browser.</p> <p>3. Behaviors</p> <p>Behaviors has not yet become a standard. It is a unique feature of Microsoft IE browser that can set some functions to the XML identity.</p> <p>Seven.dom</p> <p>DOM full name is Document Object Model (Document Object Model), what DOM is used? Suppose you see your document as a separate object, how to operate and control this object with HTML or XML.</p> <p>Object-oriented ideas have been very popular, in programming languages ​​(such as Java, JS), use object-oriented programming ideas. In XML, it is to operate and control as an object, we can build your objects and templates. Communicate with objects, how to order objects, will use the API. The API is all called Application Programming Interface, which is the rule of access and operation objects. And DOM is a detailed API describing the HTML / XML document object rule. It specifies the naming agreement, program model, communication rules, etc. of HTML / XML document objects. In the XML document, we can view each identification element as an object - it has its own name and attribute.</p> <p>XML creates an identifier, and the DOM's role is to tell Script how to operate and display these identity in the browser window.</p> <p>Above we have briefly tell some of the basic principles of XML, let's take a look at the relationship between them and how they work, first see this picture:</p> <p>1.xml Description Data Type. For example: "King Lear" is a title element; 2. CSS stores and controls the display style of the element. For example, the title will be displayed in 18pt fonts 3. How to operate on the Script script control element. For example: When a title element "Out of stock" will be displayed in red. 4. Dom provides a public platform for scripts and objects, and displays the results in the browser window.</p> <p>If an error occurs in any part, it will not get the correct result.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-95734.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="95734" 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.042</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 = 'I7_2BOYYeQndey695SVI_2Fow8NEi00FP2LRHXTLkDgqaJKIxDQ4BW76E4KBMsx1PebIHZNHfDojN53bUQIl_2FMB9Wg_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>