HTML and XML summary, HTMLXML Summary

Source: Internet
Author: User
Tags html interpreter xml parser

HTML and XML summary, HTMLXML Summary

After reading sun Xin HTML and Liu Wei XML for a while, I will summarize the learned content with a mind map.

Both HTML and XML are Markup languages.

Similarities:

  • HTML documents and XML documents have similar structures. The former is (head and body) and the latter is (Declaration and subject), which is roughly the same.
  • Both HTML and XML are composed of elements, attributes, and entities.

Differences:

  • HTML is used for display and layout, and labels are fixed.
  • XML is used for data transmission and custom tags.

To transmit data in XML, you must ensure data accuracy and consistency. Therefore, you must use DTD and Schema to describe XML and define the XML structure. It can verify whether the XML document meets the given standards. In comparison, the Schema is based on XML and can define data types.

HTML Mind Map:

Click to view the export chart

XML Mind Map:

Click to view the export chart


What is the fundamental difference between xml and html?

The syntax of Xml is similar to that of HTML. They both use a pair of starting and ending tags to identify information. However, the functions are different. HTML is used to display data information, while XML is used to describe the nature and structure of data. The differences between the two are as follows:
1. HTML integrates data with its display effect. It is a performance technology that defines how to display information labels. XML documents only store data and describe the relationship between data, there is no rule on how to display data, which separates the data from its display.
2. the HTML format requirements are relatively loose, while the HTML Parser usually adopts the mechanism of interpretation as much as possible, which may cause the same page to display large and different results in different browsers. XMlL is a very strict markup language, such as strict case sensitivity.
3. the HTMl Tag set is fixed. You cannot extend the HTML Tag in your own application. XML does not provide a set of predefined tags, but only provides a standard, you can define your own tags according to this standard. Therefore, XML tags can be infinitely scalable and can be used to describe data information in various application fields.
4. XML allows granular update. You do not need to send the content of the entire document every time a local change is made to the XML document. Only the changed elements must be sent from the server to the client, but HTML does not support such a function.
Summary: XML is neither an HTML upgrade nor an HTML replacement product. Although the two are similar, their application fields and scopes are completely different. The final version of HTML is HTML 4.01. HTMl is no longer a Web tag standard and has been replaced by XHTML. XHTML is a mixture of HTML and XML, it uses XML syntax and rules to compile Web pages. XHTML effectively combines the simplicity of HTML with the Extensible lines of XML. the tags and attributes it uses are basically the tags defined in HTML. XML can be used in finance, scientific research, and other fields. XHTML is only an application of XML in the Web field.

What is the difference between XML and HTML syntax?

On the surface, XML files are similar to HTML files. They all mark information with a pair of starting and ending tags that match each other. However, they have different functions. HTML tags are used to display data, XML tags describe the nature of data, which can be displayed in multiple ways, this is the same as putting the address book information in the fields and records of the database, rather than in the list generated by the word processor, the database allows you to combine the information in the address book into tags, envelopes, letters, or any other carrier. In the end, the XML recipe file is merged into a representation language, such as HTML.

XML tags can also be deeply processed by other applications. You can tell other programs how to use these meaningful tags; you can also put the content in the tag into a database domain by encoding, and then output it to a hard copy of a book. You can also use a word processor that supports XML to make web page publishing easy; and so on. This is the essence of XML: Enable the tag owner and the machine to read.

All Web-based developers understand that HTML has some inherent disadvantages in advanced Web applications:

1. It is a representation technology. It contains tags about how to display information, but tags and data are combined, which is difficult to split.

2. Its tag set is fixed. You cannot expand HTML tags in your own applications, and HTML is a "flat" structure. You cannot specify a data hierarchy.

3. It does not allow users to transform data for further processing. HTML is actually generated by the server, and the client only plays a role in display in a sense.

4. It provides only one "View" for data. If you want to get different views, you must regenerate an HTML webpage.

5. Its format is neither suitable for machine analysis nor suitable for people to read its source code, and its format requirements are loose. The HTML interpreter uses a mechanism as much as possible. One drawback is that the results displayed on the same page may vary greatly in different browsers.

XML is used to make up for these shortcomings. Therefore, all the functions that these HTML does not have are XML. Now let's summarize the advantages of XML:

1. XML can be used for local computing data. Data transferred to the desktop can be computed locally. The XML Parser can read data and submit it to a local application (such as a browser) for further viewing or processing. Data can also be processed by scripts or other programming languages that use the XML object model.

2. provide users with correct structured data views. Data transferred to the desktop can be expressed in multiple ways. A local dataset can be dynamically displayed to the user in the view in an appropriate form based on user preferences, configurations, and other factors.

3. Allow integration of structured data from different sources. Generally, a proxy is used to integrate data from backend databases and other applications on the intermediate layer server so that the data can be transmitted to the desktop or other servers, further aggregation, processing, and distribution.

4. Describe data from multiple applications. Because XML is extensible, it can be used to describe data from a variety of applications, from Web page set descriptions to data records. Because the data is self-described, you can receive and process data without the built-in description of the data.

5. Improve performance through granular updates. XML allows granular updates. Developers do not have to send the entire structured dataset every time there is a change. With granular updates, only the changed elements must be sent from the server to the client. Changed data can be displayed without refreshing the entire page or table.

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.