All 'bout XML
Assalamualaikum...hey, we meet again (^.^)V How are u?Actually, we already been using XML since its creation. This is because it is the common tool for data transmission between applications and becoming more and more popular from the perspective of data storage and describing data. How XML separates data from HTML?
As example here is a note to Terry from John
<note>
<to>Terry</to>
<from>John</from>
<heading>Reminder</heading>
<body>Call me before 6 p.m.!</body>
</note>
1) XML Syntax Rules:
2) XML Tags are Case Sensitive:
<message>This is correct</message>
3) XML Elements Must be Properly Nested
Correct: <b><i>This text is bold and italic</b></i
Incorrect: <b><i>This text is bold and italic</i></b>
4) XML Documents Must Have a Root Element
XML documents must contain one element that is theparentof all other elements
Correct: <b><i>This text is bold and italic</b></i
Incorrect: <b><i>This text is bold and italic</i></b>
4) XML Documents Must Have a Root Element
XML documents must contain one element that is theparentof all other elements
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
5) XML Attribute Values Must be Quoted
Correct:
<note date=12/11/2007>
<to>Terry</to>
<from>John</from>
</note>
Incorrect:
<note date="12/11/2007">
<to>Terry</to>
<from>John</from>
</note>
As conclusion, there are 2 obvious differences between XML and HTML:
| XML | HTML |
|---|---|
| Designed to transport and store data, with focus on what data is | Designed to display data, with focus on how data looks |
| Carry information | Display information |
For more info, visit this site.
