You ask me and answer: the difference between XML and HTML


Q: I wonder what is the difference between XML and HTML? What’s the difference between them?
A: AboutXMLPlease refer to:
Extensible markup language(XML)Provides a way to describe structured data. Unlike HTML tags, which are mainly used to control the display and appearance of data,XMLTags are used to define the structure and data type of the data itself.
  XMLUse a set of tags to depict data elements. Each element encapsulates data that can be very simple or complex. You can define an unlimited set ofXMLMarking. For example, you can define someXMLTag to declare the data in the order, such as price, tax, shipping address, billing address, and so on. becauseXMLTags are used throughout the company and across companies, so data from different data stores will be easier to exchange and operate.
  XMLIt is a simple, platform independent and widely adopted standard.XMLThe advantage over html is that it separates the user interface 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, catalog data, and other information can be converted intoXML
Here are some things to remember aboutXMLSeveral key points of the relationship with HTML:
   a.. XMLNot to replace HTML; actuallyXMLIt can be regarded as a supplement to HTML.XMLDifferent from the goal of HTML: the design goal of HTML is to display data and focus on the appearance of data, whileXMLThe design goal of is to describe the data and focus on the content of the data.
B… similar to HTML,XMLDo nothing. althoughXMLThe tag can be used to describe the structure of items such as an order, but it does not contain any code that can be used to send or process the order and ensure delivery according to the order. Others must write code to actuallyXMLFormat data to perform these operations.
C. different from HTML,XMLTags are defined by the author of the schema or document and are unlimited. HTML tags are predefined; HTML authors can only use tags supported by the current HTML standard.
  XMLUse of
  XMLIt is a very flexible way to transfer data. The following are all availableXMLExamples of occasions:
A. general documents
B. structured records, such as appointment records or orders
C. internet/intranet web applications for mobile data
D. persistent format of objects with data, such as objects or ActiveX controls
E. data records, such as the result set of the query
F. meta content of the web site, such as “channel definition format” (CDF)
G. graphical display, such as the user interface of the application
H. links between information and people on the web
I.. C # code (can be usedXMLForm); For more information, seeXMLfile
J.. Available for positioningXMLDiscovery documents of Web services; For more information, seeXMLWeb services discovery.
When storing information listed belowXMLSeveral advantages over other formats:
   a.. XMLFormats are text-based, which makes them easier to read, easier to record, and sometimes easier to debug.
   b.. XMLDocuments can use many infrastructures that have been established for HTML, including HTTP protocol and some browsers. HTTP allows transmission through the firewallXML
   c.. XMLAnalysis has been well defined and has been widely used, making it possible toXMLIt is possible to retrieve information from documents.
D. applications can rely onXMLThe analyzer performs some structural validation and data type checking (when using schemas).
   e.. XMLBased on Unicode, it makes it easier to create international documents. however,XMLNot suitable for all situations.XMLDocuments are often more detailed than the binary format they replace. They occupy more network bandwidth and storage space, or require more processor time for compression.XMLParsing may be slower than parsing highly optimized binary formats and may require more memory. However, careful application design can
Avoid some problems.
To verifyXMLThe document contains the required data and structure, and aXMLArchitecture andXMLAssociated with the document.XMLArchitecture defines how to construct elements and attributes to formXMLRules for documents. You can share the architecture between units to make it easy to transfer and process shared data. For more information, seeXMLArchitecture introduction.
There are several ways to display (or provide)XMLdata
There is also a mechanism for data binding that can be used with style sheets for visual presentationXMLData, and add interactivity.
The following is the displayXMLSeveral methods of:
A.. XSLT — extensible stylesheet language
B.. CSS – cascading style sheets
   c.. Microsoft Internet Explorer
For more information, see MSDN OnlineXMLDeveloper Center Web site
If you are familiar with HTML, you can learn to createXMLDocuments are only required to be valid and conform to the standard format. of
  XMLFor more information, seeXMLSDK and MSDN OnlineXMLDeveloper Center Web site
For more information, see the World Wide Web Consortium (W3C)XMLstandard

Q: why do many large websites still use HTML instead of XML?

  A:XMLIt is essentially different from HTML. You say that large sites use HTML. If it is static data, it is the fastest to use HTML, but the maintenance is poor!
General useXMLCSS for site design, butXMLCSS has great limitations, so it’s better to use itXMLXSLT

Q: now I directly use XML to develop a website, and then upload it directly to the ordinary static space provided now. Can it be displayed?

A: if you can assume that users use (or at least install) IE6, there is no problem.
If users use other browsers, they should do it on the server sideXML->HTML conversion is not supported in ordinary static space. Optional supportXMLASP or php space of DOM. Therefore, the operating environment is different.

Recommended Today

JS generate guid method

JS generate guid method Globally unique identification(GUID) is an algorithm generatedBinaryCount Reg128 bitsNumber ofidentifier , GUID is mainly used in networks or systems with multiple nodes and computers. Ideally, any computational geometry computer cluster will not generate two identical guids, and the total number of guids is2^128In theory, it is difficult to make two […]