Favor XML over JSON when any of these is true:
- You need message validation
- You're using XSLT
- Your messages include a lot of marked-up text
- You need to interoperate with environments that don't support JSON
Favor JSON over XML when all of these are true:
- Messages don't need to be validated, or validating their deserialization is simple
- You're not transforming messages, or transforming their deserialization is simple
- Your messages are mostly data, not marked-up text
- The messaging endpoints have good JSON tools
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…