<person sex="female">



第一段的female是 attribute  第二段的female是 element

W3school的筆者建議用Element  這樣的辨識度比較高


  • attributes cannot contain multiple values (elements can)
  • attributes cannot contain tree structures (elements can)
  • attributes are not easily expandable (for future changes) 
  • 啥時用到Attibutes?

    metadata (data about data) should be stored as attributes, and the data itself should be stored as elements

    也就是資料的ID 或是序號


      <note id="501">
        <body>Don't forget me this weekend!</body>



    找女人 發表在 痞客邦 留言(0) 人氣()