What's the accepted way of storing quoted data in XML?

前端 未结 7 1285
攒了一身酷
攒了一身酷 2021-01-04 01:01

What\'s the accepted way of storing quoted data in XML?

For example, for a node, which is correct?

  • (a) Jesse \"The Body\" Ventura
7条回答
  •  醉酒成梦
    2021-01-04 01:50

    It depends really. If all you want to do is have quotes in your XML string, then 'A'.

    But if there is meaning or you need to abstract the quote (i18n for example), XML affords richer options. For example:

    
      Jesse
      Ventura
      the Body
    
    

    Overkill in many situations. But if you need to correctly handle many of the world's varied - and frequently inconsistent - naming schemes, I'd think about encoding your names along these lines. XML is great for this.

提交回复
热议问题