The difference between XML and HTML

Source: Internet
Author: User
Tags html tags require xslt

Extensible Markup Language (XML) provides a way to describe structured data. Unlike HTML tags, which are primarily used to control the display and appearance of data, XML tags are used to define the structure and data types of the data itself.

XML uses a set of tags to depict data elements. Each element encapsulates data that can be very simple or potentially complex. You can define a set of unrestricted XML tags. For example, you can define some XML tags to declare data in an order, such as price, tax, shipping address, billing address, and so on. Because XML tags are used throughout the organization and across units, data from a variety of different data stores is easier to swap and manipulate.

XML is a simple, platform-independent and widely adopted standard. The advantage of XML in relation to HTML is that it separates the user interface from structured data. This separation of data from display makes it possible to integrate data from different sources. Customer information, orders, research results, billing payments, medical records, catalog data, and other information can be converted to XML.


Here are a few key points to remember about the relationship between XML and HTML:

Avoid some problems.

Validating an XML document

To verify that the XML document contains the required data and structure, you must associate an XML schema with an XML document. An XML Schema is a rule that defines how elements and attributes are constructed to form an XML document. You can share schemas between organizations to make it easy to transfer and process shared data. For more information, see XML Schema Introduction.

displaying XML data

There are several ways to display (or provide) XML data.

There are also mechanisms for data binding that can be used with style sheets to visually present XML data and to add interactivity.

Here are a few ways to display XML:

A.. xslt-Extensible Stylesheet Language

B.. css-Cascading Style Sheet

C.. Microsoft Internet Explorer

For more information, see the MSDN Online XML Developer Center Web site (

XML Resources

If you are familiar with HTML, you can learn to create XML documents that only require them to be valid and conform to standard formats. For more information about XML, see XML SDK and MSDN Online XML Developer Center Web site (

Q: Why are there many large Web sites, or HTML instead of XML?

A:xml and HTML are essentially different, you say that large sites use HTML, if it is static data with HTML speed of course the fastest, but poor maintenance!

General use XML+CSS for site design, but XML+CSS limitations are relatively large, or with XML+XSLT bar

Q: Now I am directly using XML to develop a Web site, and then directly uploaded to the current provided by the normal static space, it can show it?

A: If you can assume that the user is using (or at least device) IE6, there is no problem.

If users use other browsers, it should be on the server side of the xml->html conversion, normal static space does not support. You can select an ASP or PHP space that supports XMLDOM. Therefore, the operating environment is different.

A.. XML is not to replace HTML; XML can actually be viewed as a complement to HTML. XML and HTML have different goals: The goal of HTML is to display data and focus on the appearance of the data, while XML is designed to describe the data and focus on the content of the data.

B. Like HTML, XML does nothing. Although XML tags 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 to ensure delivery on that order. Others must write code to actually perform these operations on XML-formatted data.

C. Unlike HTML, XML tags are defined by the author of the schema or document and are unrestricted. HTML tags are predefined; HTML authors can only use tags that are supported by the current HTML standard.

Use of XML

XML is a very flexible way of passing data. All of the following are examples of situations where you can use XML:

A.. ordinary documents

B. Structured records, such as Appointment records or orders

C. internet/intranet WEB application for moving data

D.. An object with data, such as a persistent format for an object or ActiveX control

E. Data logging, such as the result set of a query

F. Content of the Web site, such as Channel Definition Format (CDF)

G. Graphical display, such as the user interface for an application

H. Links to information and people on the Web

I.. C # code (which can be in XML); For more information, see XML documentation

J. A discovery document for locating an available XML Web services; For more information, see XML Web Services discovery.

The following lists some of the advantages of XML relative to other formats when storing information:

A.. XML formats are text-based, making them easier to read, easier to record, and sometimes easier to debug.

B.. XML documents can use many of the infrastructure that has been built for HTML, including the HTTP protocol and some browsers. HTTP allows XML to be transferred across the firewall.

C. XML parsing is well defined and widely used, making it possible to retrieve information from XML documents in a variety of environments.

D. Applications can rely on XML parsers for some structural validation and data type checking when using schemas.

E.. XML is built on a Unicode basis, making it easier to create internationalized documents. However, XML is not suitable for all situations. XML documents tend to be more verbose than the binary formats they replace. They consume more network bandwidth and storage space, or require more processor time for compression. XML parsing may be slower than parsing a highly optimized binary format, and may require more memory. However, careful application design can

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: 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.