<person sex="female"> <firstname>Anna</firstname> <lastname>Smith</lastname> </person> |
<person> 第一段的female是 attribute 第二段的female是 element W3school的筆者建議用Element 這樣的辨識度比較高 還有三大重點 |
啥時用到Attibutes?
metadata (data about data) should be stored as attributes, and the data itself should be stored as elements
也就是資料的ID 或是序號
比方說
<messages>
<note id="501">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
全站熱搜
留言列表