Differences between xml and html

Source: Internet
Author: User
Tags xslt
Q: What is the difference between xml and html? Where are their differences? A: For the differences between XML and HTML, see http://www.w3c.org/markup/http://www.w3c.org/xml/extended reading: is XML? Extensible Markup Language (XML) provides a description of structured data

Q: What is the difference between xml and html? Where are their differences?

A: For the differences between XML and HTML, see:

Http://www.w3c.org/MarkUp/
Http://www.w3c.org/XML/

Extended reading: What is XML?

The Extensible Markup Language (XML) provides a method to describe structured data. Unlike HTML tags that are mainly used to control the display and appearance of data, XML tags are used to define the structure and data type of the data.

XML uses a group of tags to depict data elements. Each element may encapsulate very simple or complex data. You can define an unlimited set of XML tags. For example, you can define XML tags to declare order data, such as price, tax, shipping address, Bill address, and so on. Because XML tags are used across the entire unit and across units, data from different data storage areas is easier to exchange and operate.

XML is a simple, platform-independent and widely used standard. Compared with HTML, XML separates user interfaces from structured data. This separation of data and display makes it possible to integrate data from different sources. Customer information, orders, research results, bill payments, medical records, directory data, and other information can all be converted to XML.

XML and HTML
The following are the key points to remember about the relationship between XML and HTML:

A. XML does not need to replace HTML. XML can be regarded as a supplement to HTML. The goals of XML are different from those of HTML: HTML is designed to display data and concentrate on data appearance, while XML is designed to describe data and concentrate on data content.
B. 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 to ensure delivery by that order. Others must write code to actually perform these operations on data in XML format.
C. 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.

XML usage
XML is an extremely flexible way to transmit data. The following are examples of XML usage:

A. common document
B. structured records, such as appointment records or orders
C. Internet/Intranet Web applications for mobile data
D. objects with data, such as objects or ActiveX controls in persistent format
E. data records, such as the query result set
F .. metadata of the Web site, such as "Channel Definition Format" (CDF)
G .. graphic display, such as the application user interface
H .. link between information and people on the Web
I. C # code (in XML format). For more information, see the XML documentation.
J. used to locate the discovery documentation for available XML Web services. For more information, see XML Web services discovery.

The following lists some advantages of XML over other formats when storing information:

A. XML format is text-based, which makes it easier to read, record, and debug.
B. XML documents can use a lot of infrastructure that has been created for HTML, including HTTP protocol and some browsers. HTTP allows XML transmission through the firewall.
C. XML analysis has been well defined and widely used, making it possible to retrieve information from XML documents in various environments.
D. The application can rely on the XML analyzer for some structure verification and data type check (when using the architecture ).
E. XML is based on Unicode, making it easier to create international documents. However, XML is not suitable for all situations. XML documents are often more detailed than the binary format they are replaced. They occupy more network bandwidth and storage space, or require more processor time for compression. XML analysis may be slower than analysis in a highly optimized binary format and may require more memory. However, a well-designed application can
Avoid some problems.

Verify the XML document
To verify that an XML document contains the required data and structure, you must associate an XML schema with an XML document. XML architecture defines how to construct elements and attributes to form XML document rules. You can share the architecture between units to make it easy to transmit and process shared data. For more information, see XML Architecture introduction.

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

The data binding mechanism can also be used with the style sheet to display XML data visually and add interactivity.

The following are several ways to display XML:

A. XSLT-extensible style sheet language
B. CSS-Cascading Style Sheets
C. Microsoft Internet Explorer
For more information, see the MSDN Online XML Developer Center Web site
Http://msdn.microsoft.com/xml/default.asp ).

XML resources
If you are familiar with HTML, you can learn how to create XML documents and only require them to be valid and conform to the standard format. Related
For more information about XML, see the xml sdk and the MSDN Online XML Developer Center Web site.
Http://msdn.microsoft.com/xml/default.asp ).

For more information, see XML specifications of the World Wide Web Federation (W3C ).
Http://www.w3.org/XML ).


Q: Why are there many large websites still using html instead of xml?


A: XML and HTML are actually different. you said that HTML is used for large websites. if static data is used for HTML, the speed is certainly the fastest, but the maintenance is poor!
Generally, XML + CSS is used for site design, but XML + CSS has many limitations. let's use XML + XSLT.


Q: Can I directly use xml to develop a website and then directly upload it to the normal static space provided now?


A: If you can assume that all users are using (or at least installed) IE6, there is no problem.

If you are using other browsers, you should convert the XML-> HTML on the server side, which is not supported by normal static space. You can select an ASP or PHP space that supports XMLDOM. Therefore, the running environment is different.

 

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.