Learn the basics of XML you should know

Source: Internet
Author: User
Tags format define definition data structures xsl advantage
XML has always been a very short of feeling, until I saw this article, it finally let me learn more about its mastery, originally, it is so affinity.

XML has always been a very short of feeling, until I saw this article, it finally let me learn more about its mastery, originally, it is so affinity. XML, XLink, Namespace, DTD, Schema, CSS, XHTML, these inexplicable words are not so vexatious as we imagined. If you are a beginner of XML language, then I strongly recommend that you read the 10 descriptions of XML's own features, and you can clearly understand some of the basic concepts of XML and then digest it and apply it to your program design.
First of all, it is necessary to point out that the article is from the network, the original English text for w3c.org official release: XML in points Chinese translation specifically ominous
1. XML is used to organize data structures
The structure data includes such as: Electronic data table, address Book, controller parameter, financial transaction and technical drawing, etc. XML is a series of rules for writing format design (also known as guidelines or conventions) to help you organize your data structures. XML is not a programming language, so you don't have to be a programmer to use or learn it. XML enables computers to simply generate and read data, and to ensure the structure is accurate. XML avoids the pitfalls of general language design: It is extensible, cross-platform, internationalized, and regionalization, and absolutely supports Unicode format.
2. XML is similar to HTML
Like HTML, XML is used in tags (with "<" and ">" inclusions) and attributes (in the form of "name" = "value"). Once the HTML specifies the definition of each label and attribute, and the general text is represented in the browser, XML uses only these tags to define the special meaning of some data, but the meaning of the whole sentence is defined as the individual application reads. In other words, if you see a "

" in an XML file, do not assume it is the meaning of the paragraph. Depending on the interpretation of the XML context, it may be a price-Quot;price ", a parameter list" parameter, "a person", "or ... (So who can define a "P" word?)
3. XML is text, but not read
Programs that make spreadsheets, address books, and other results data are typically stored on disk and stored in binary or text format. The advantage of the text storage format is that people read the text when they need it, without having to make a program for the file; In addition, you can also use your favorite word processor to read the file. Text formatting also allows developers to understand applications more easily. If the Html,xml file is some people do not need to read, but if necessary, can also read the text file. Not much like the html,xml rules are very strict. If you forget a tag or attribute that misses a quote, the XML file cannot be executed, but in HTML these errors are acceptable. A formal XML definition prevents a program from trying to guess the meaning of the corrupted XML file, and if a corrupted file is found, the application immediately stops there and reports the error message.
4. XML is very detailed
Because XML is a text format and its use of tags to liberate data, XML files are almost as large as all file files in binary format. This is often the XML designer must pay attention to and consider. The advantage of the text format is that everything is clear (see article 3rd), but there are also varying degrees of disadvantage. The cost of disk space is significantly lower than before, while other file compression programs such as ZIP and gzip compress files quickly and easily. In addition, communication protocols on the network, such as data-machine communication protocol and http/1.1 can be compressed in the transmission of data, save efficiency and binary format of the file is also efficient!
5. XML is a large family of technology
XML1.0 defines the label "tags" and the attribute "attributes" definition. Beyond XML1.0, the "XML family" is a growing technical project to provide useful services to meet a number of important and demanding jobs. XLink explains how to join the link to an XML file. XPointer and xfragments documents are part of the development of the grammar. XPointer is a bit like a URL, but it also points to a piece of data in an XML file, except to point to an online file. css~ defines the file model language, using XML as the same as in HTML. XSL is an advanced language that expresses the layout style "style sheets". Based on XSLT, a transformational language used to rearrange, add, or deduct labels and attributes. Dom is a set of criteria that is used to call XML files (and HTML files) from a programming language. XML Schemas 1 and 2 help developers precisely define their own set of XML base formats. There are other kinds of projects and tools that can be considered or are being developed. Can pay more attention to the technical reports of the consortium.
6. XML is a new thing, but not a new product
The development of XML began in 1996 and became the recommended document for the consortium in February 1998; This may make you think this is not a very mature technology. But in fact, this technology is not as new as imagined! There was SGML developed in the early 80 in XML, an ISO standard from 1986 and widely used in large file planning projects. HTML developed since 1990. XML designers can develop some of the best parts of SGML to develop HTML experience Guidelines for developing techniques that are inferior to SGML but more standardized and simpler to use. Although it is sometimes difficult to distinguish between evolution and revolutionary achievements ... But it is certain that when SGML is widely used in technical documents and neglected by other kinds of data, XML is just the opposite!
7. XML leads HTML to XHTML
An important text-based XML application: The XHTML of the Consortium, a format that replaces HTML. XHTML has many of the same primitives as HTML. There are some syntaxes that have changed to match XML rules. A file using the "XML base" replaces and restricts the syntax of the XML in some ways (for example: XHTML allows "

" but does not accept ""); it adds some meaning to the syntax (XHTML specifies "

" The meaning of the paragraph is "paragraph", rather than price "" or "person" or other thing.
8. XML is Modular
XML allows you to customize the new file format by merging and then using other formats. Since the two independently developed formats may contain some raw materials or titles with the same name, it is particularly cautious when merging these formats (such as "

" on behalf of "paragraph paragraph" in a document may represent "person" on the other side?) To resolve the problem of name confusion when merging using both formats, XML provides a concept called namespace. XSL and RDF are namespaces XML based formats. XML schemas combine two specifications in a simple way to evolve a third format that contains two specifications that reflect the support that is used to guide the XML file structure.
9. XML is the basis of RDF and Semantic web
XML provides a normative code for the RDF of the consortium, a language used to express information (in fact, essentially knowledge). RDF is like the next level of online connectivity. General online links Connect some text to something that is not fixed, only RDF can give a relation name to any thing after it is connected: if "A is a price of B" can be the relationship between an item and a price sum, another example is "a ratio B" can be a two-sum relationship; or "A is the cause of B" It can be a relationship between bathing and your body being wet. When you are in the knowledge of communication, whether in the XML/RDF or in pure English, people or machinery must agree to the use of a word. A series of specific words that can be used to describe a particular lifestyle (from "shopping" to "mathematical Logic") is called "Ontology". RDF, ontologies and its representational meaning, enables the computer to help us perform all semantic web activities.
XML is not copyright limited, cross-platform independent and easy to maintain
When you choose XML as the basis for your plan, you have acquired some of the huge and growing tools (some of which may have done what you need) and the technical experience accumulated by engineering technicians for many years. Choose to use XML as a program for selecting SQL in database management: You still have to build your own database and your own programs and procedures, and there are many tools and many people to help you. Since XML is not subject to copyright restrictions, you can build your own software without paying any fees to others. And the huge and growing support means that you don't have to rely on any single firm. XML does not always represent the best solution, but it is always worth considering.



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.