XML attribute vs XML element

前端 未结 20 2243
暖寄归人
暖寄归人 2020-11-22 01:34

At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of ou

20条回答
  •  时光说笑
    2020-11-22 02:05

    Attributes can easily become difficult to manage over time trust me. i always stay away from them personally. Elements are far more explicit and readable/usable by both parsers and users.

    Only time i've ever used them was to define the file extension of an asset url:

    wank.jpg ...etc etc
    

    i guess if you know 100% the attribute will not need to be expanded you could use them, but how many times do you know that.

    
      wank.jpg
      gif
    
    

提交回复
热议问题