1. The Difference Between XML and HTML
- XML was designed to carry data - with focus on what data is
- HTML was designed to display data - with focus on how data looks
- XML tags are not predefined like HTML tags are
2. Example of XML
<?xml version="1.0" encoding="UTF-8"?>
<note>
<date format="yyyy-mm-dd">2018-12-18</date>
<hour>21:00</hour>
<to>N.M</to>
<to N.M /> #the same as above
<from>Zhang</from>
<body>Don't forget that thing</body>
</note>
3. XML Attribute
<date format="yyyy-mm-dd">2018-12-18</date>
The thing format="yyyy-mm-dd"
is the attribute, and it must always be QUOTED
4. XML Comments
<!-- This is a comment -->
网友评论