When we first come into contact with php or HTML, we will encounter HTML and XML, but what is the difference between them? In this article, we mainly share with you the analysis of the differences between HTML and XML, hoping to help you.
1. HTML is called Hypertext Markup Language;
##XML is an extensible markup language; It has no tag set (tagset), there is no grammatical rule (grammatical rule), but it has syntax rule (syntax rule). Any XML document must be well-formed for any type of application and correct parsing, that is, each open tag must have a matching closing tag, must not contain tags in reverse order, and must be well-formed in statement composition. Should meet the requirements of technical specifications. An XML document can be valid, but it does not necessarily need to be valid. A valid document is a document that conforms to its document type definition (DTD). A document is schema valid if it conforms to the provisions of a schema.
2. The difference between HTML and XML:
xml and html are both used to manipulate data or data structures , are roughly the same in structure, but there are obvious differences in their essence. A summary of various information on the Internet is as follows
(1)Different grammatical requirements
1. is case-insensitive in html and in xml## Strictly distinguish between #.
2.In HTML, sometimes loosely, if the context clearly shows the paragraph or list key Where it ends, then you can omit the closing tags such as
or . In XML, it is a strict tree structure, and the end tag must not be omitted. 3.In XML, elements that have a single tag without a matching closing tag must be / characters as the end. This way the parser knows not to look for the closing tag.
4.In XML, attribute values must be enclosed in quotation marks. In HTML, quotation marks are available or not. 5. In HTML, you can have attribute names without values. In XML, all attributes must have corresponding values. 6. In the XML document, the white space will not be parsed Automatically deleted; but html filters out spaces. (2) Different marks
1, html uses inherent tags; xml does not have inherent tags. 2、Html tags are predefined; XMLtags are free, customizable, and scalable. (3) different functions
##1. html is used to display data; xml is used to describe and store data, so it can be used as a persistence medium! Html Combine data and display and display the data on the page; xml then Separate data and display. XML is designed to describe data, with the focus being the content of the data. HTML is designed to display data, with the focus being on the appearance of the data. 2. xml is not a replacement for HTML, xml and html are two languages with different uses. XML is not meant to replace HTML; in fact XML can be regarded as a supplement to HTML . XML and HTML have different goals HTML is designed to display data and Focus on the appearance of data, while the design goal of XML is to describe data and focus on the content of the data. 3. No behaviorXML. Similar to HTML , XML does nothing. (Common ground) 4. The best way to describe XML is probably : XML is a cross-platform, software- and hardware-independent tool for processing and transmitting information. 5. XML will be everywhere in the future. XML will become the most common tool for data processing and data transmission. Related recommendations: What is the difference between html, xhtml and xml
The above is the detailed content of Analysis of the differences between HTML and XML. For more information, please follow other related articles on the PHP Chinese website!