什么时候更喜欢JSON而不是XML? [英] When to prefer JSON over XML?
本文介绍了什么时候更喜欢JSON而不是XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的要求就是在展开时显示从数据库中检索的一组值。我正在使用jquery。
My requirement is just to display a set of values retrieved from database on a spread. I am using jquery.
推荐答案
当其中任何一个为真时,支持XML over JSON:
Favor XML over JSON when any of these is true:
- 您需要消息验证
- 您正在使用XSLT
- 您的消息包含大量标记文本
- 您需要与不支持JSON的环境进行互操作
- 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
当所有这些都成立时,支持JSON over XML:
Favor JSON over XML when all of these are true:
- 消息不需要验证,或验证它们的反序列化很简单
- 您没有转换消息,或者转换它们的反序列化很简单
- 您的消息主要是数据,而不是标记文本
- 消息传递端点具有良好的JSON工具
- 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
这篇关于什么时候更喜欢JSON而不是XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文