To figure out the difference between html and xml, we first need to understand xml
2.1 Understanding xml
XML is an extensible markup language, which looks very similar to html, and its functions are more focused on transmitting and storing data
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
The above xml content can be expressed as the following tree structure:
2.2 The difference between xml and html
The difference between the two is as shown in the figure below
-
html:
-
Hypertext Markup Language
-
In order to better display the data, the focus is to show
-
-
xml:
-
Extensible Markup Language
-
In order to transmit and store data, the focus is on the data content itself
Knowledge points: understand the difference between xml and html