XML与JSON来表示数据库数据 [英] XML vs JSON to represent database data
本文介绍了XML与JSON来表示数据库数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想了解这两种技术(XML或JSON)中哪一种更适合用于数据库中的数据。我需要解析这些文件之一的数据,并使用我的程序。
I am trying to understand which of these two technologies, XML or JSON, is better to use for data from a DB. I need to parse data from one of these files and use it my program. And I am trying to see which APIs should I consider for ease of use and design perspective.
推荐答案
选择XML if
- 已经有一个符合行业标准的XSD。
- 新的XSD对您或您的
调用者很重要。 - 您需要将数据转换为另一个XML格式。 (XSLT为转换创造奇迹。)
- 或者,您必须表示混合内容(文字中混合的标签)。
- There's already an industry standard XSD to follow.
- Validation afforded by creating a new XSD is important to you or your callers.
- You need to transform the data to another XML form. (XSLT works wonders for transformations.)
- Or, you have to represent mixed content (tags mixed within text).
选择JSON
- 更贴近JavaScript对您或您的
- 或者,上述用于选择XML的原因不适用于您。 >
- The closer fit to JavaScript is valuable to you or your callers.
- You prefer a lighter-weight solution.
- Or, the reasons mentioned above for choosing XML do not apply to you.
这篇关于XML与JSON来表示数据库数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文