xml| comparison
Two. Comparison of XML and HTML let's look at an example:
There is a student's information: including the student's number, name, gender, age.
We use three expressions to represent this student's message.
The student's information data are the same: 001, John, Male, 20
We first use HTML to show 3 different representations, but the data we use for this student is the same.
The first form of expression:
The effect displayed:
001, John, Male, 20
HTML Source code:
<body>
001, John, Male, 20
</body>
The second expression: the effect of the display:
|
001 |
name |
John |
sex |
male |
age |
20 |
|
HTML Source code:
<body>
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "bgcolor=" #000000 ">
<tr>
<td>
<table width= "border=" 0 "cellspacing=" 1 "cellpadding=" 0 "bgcolor=" 1 ">
<tr>
<td> number </td>
<td>001</td>
</tr>
<tr>
<td> name </td>
<td> John </td>
</tr>
<tr>
<td> Sex </td>
<td> male </td>
</tr>
<tr>
<td> Age </td>
<td>20 </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
The third expression: the effect of the display:
Student Information
Number:
Gender:
Name:
Age:
HTML source code:
<body>
<p> Student Information </p>
<p> No:
< Input type= "text" name= "TextField" value= "001"
</p> Gender:
<input type= "text" Name= " Textfield2 "value=" "
<p> Name:
<input type=" text "name=" textfield3 "value=" John "
</p>
<p> Age:
<input type= "text" name= "Textfield4" value= ""
</p
<p>
<input type= "Submit" name= "submit" value= "Submit" >
<input type= " Submit "Name=" Submit2 "value=" Reset ">
</p>
</body>
Look at the above example, what are the comrades ' thoughts? Does
feel that HTML is getting fatter and harder to find data through source code? The
HTML itself has many drawbacks, such as content and page layout, presentation, and excessive bloat. Information stored in the database, after the interpretation and conversion of cgi,asp to HTML format, the original format of the information has become unrecognizable. The gradual popularity of E-commerce, the shortcomings of the HTML itself has hindered his development.