[Reprinted] the difference between HTML and XML: Reprinted htmlxml

Source: Internet
Author: User
Tags php server

[Reprinted] the difference between HTML and XML: Reprinted htmlxml

Source Address http://blog.163.com/txl129_2006@126/blog/static/1851087820103218453645/

Changed.

 

What is HTML?

The full combination of HTML is Hypertext Markup Language, and Chinese is also the Hypertext link Markup Language. HTML (HyperTextMark-upLanguage) is a hypertext markup language. It is a WWW Description Language. The purpose of designing the HTML language is to easily link the text or graphics stored in one computer with the text or graphics stored in another computer to form an organic whole, people don't have to consider whether the specific information is on the current computer or on other computers on the network. We only need to use the mouse to point an icon in a document, and the Internet will immediately jump to the content related to this icon, and this information may be stored in another computer on the network. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, and so on. The structure of HTML consists of the header and Body. The header describes the information required by the browser, and the Body contains the specific content to be described. In addition, HTML is a common network language, a simple and common fully-configured markup language. It allows web producers to create complex pages that combine text and images. These pages can be viewed by anyone else on the internet, regardless of the type of computer or browser they use.

  What is XML

XML is Extentsible Markup Language (Extensible Markup Language). It is a metalanguage used to define other languages. Its predecessor is SGML (Standard Generic Markup Language ). It does not have a tag set or grammatical rule, but it has syntax rule ). Any XML document must be well-formed for any type of applications and correct parsing, that is, each opened tag must have a matched end tag, do not include tags in reverse order, and the statement composition should comply with the technical specifications. XML documents can be valid, but they are not necessarily required. A valid document is a document that complies with the document type definition (DTD. If a document complies with a schema, this document is schema valid ).

  Relationship between HTML and XML

1. In fact, there is no inevitable link between HTML and XML. XML is not to replace HTML. In fact, XML can be regarded as a supplement to HTML.

2. Different goals for XML and HTML: HTML is designed to display data and concentrate on the Data appearance. XML is designed to describe data and concentrate on data content.

3. Similar to HTML, XML does not perform any operations. Although the XML tag can be used to describe the structure of an item such as an order, it does not contain any code that can be used to send or process the order and ensure delivery by the order, others must write code to actually perform these operations on data in XML format.

4. Unlike HTML, XML markup is defined by the author of the architecture or document and is unrestricted. HTML tags are predefined. HTML authors can only use tags supported by the current HTML standard.

  Common Problems

Q: What are the advantages and disadvantages of XML and HTML?

A: In fact, there is no comparability between XML and HTML. Although there is a certain link between them, their respective functions and objectives (Focus) are different. The application scenarios are different. One thing to mention is that, XML is more standard than HTML.

Q: Can HTML support static space and XML?

A: Yes. Make sure that the browser version of the client is no lower than 6.0.

Q: What language should I use to create a website?

A: For large websites, HTML is not recommended because of the large number of updates. XML supports dynamic updates and can be used, but is not the best choice. For small websites, to speed up page response, we recommend using HTML.

Q: Can HTML and XML be converted to each other?

A: Yes. To better adapt to browser browsing on the client, you can convert XML-> HTML on the server side. However, normal static space does not support this conversion, you can select an ASP or PHP server that supports XMLDOM.

 

XML is a markup language similar to HTML.

XML is used to describe data.

XML tags are not pre-defined in XML. You must define your own tags.

XML uses document type definition (DTD) or Schema to describe data.

After using DTD or Schema, XML is a self-described language.

What are the main differences between XML and HTML?

XML is used to store data.

XML is not a substitute for HTML. XML and HTML are two different languages.

 XML is designed to describe data, focusing on what is data and how to store data.

HTML is designed to display data. The focus is on displaying data and how to display data better.

HTML is related to display information, while XML is related to description information.

"XML" is a language used for data exchange on the network and is similar to the "HTML" language used to describe web pages. This language has the advantages of "data validation with Web browsers" and "easy to generate data". Therefore, it is mainly used between enterprises, or you can exchange and use data more conveniently within the enterprise. First, for ease of understanding, we suppose there is a situation where a book seller wants to establish its own site and send information such as the variety directories and inventory in the bookstore.

When managing books, you need to use TABLE tags, etc, provide data such as "title", "Release Date", "inventory", "author", "publisher", and "pricing" in the form of a list. After summarizing data in this form, if you are a person, you can quickly learn what you need. However, even if a computer (or system) can understand the page structure or data layout, it cannot understand the meaning (attribute) of the data here ).

However, "XML" is a technology that allows computers to understand these data attributes.

If XML is used, for example, "How much inventory is there currently ?" And "How many books do a writer sell ?" The data can be automatically controlled by the computer and shared with the transaction object ". In this way, the publishing house will be able to refer to the data when developing future publishing plans, and it will be easier for the sales company to develop effective distribution plans. This will definitely help reduce personnel costs and improve management efficiency.

Of course, even if you do not use XML, for example, if you can create a standard database and define a name for each field, such as "name" and "pricing", the computer can understand it. However, it takes considerable manpower and cost to achieve this on the Web. In this case, if XML is used, as "data can be validated using a Web browser", as long as you have a computer that can connect to the Internet and a browser that supports XML, no special investment is required.

XML can also be used to convert data that is difficult to process in a previous database into a database.

The description of XML is the same as that of HTML. It is described by a string enclosed by parentheses. In HTML, Layout and other information are defined in brackets. XML defines data attributes at the same time. For example, the books just mentioned are defined by means of <title>, <author>, and <publisher>. You can set a definition like this. Therefore, many enterprises even define their own XML and then use it for internal data exchange within the company. This high degree of freedom is also one of the reasons why XML has received great attention.

However, data exchange between enterprises is one of the focuses of XML. Therefore, the definitions of companies cannot be used in general if they are not standardized. Currently, Microsoft-based standardization groups Biztalk.org and Rosetta Net all hope to develop "widely available logos" for various industries and fields ", to reduce the trouble of defining XML.

If, as mentioned above, XML standards can be developed and widely used, data exchange between enterprises will become simpler, in addition, Speech data, dynamic image data, and other hard-to-process data in past databases will be easily converted into databases. This is also a huge advantage in terms of management.

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.