什么是XML,我应该怎么使用它? [英] What is XML good for and when should i be using it?
问题描述
目前我使用MySQL和JSON,我没有这种我需要学习(XML)的感觉,这一定是错误的!
我真的有兴趣听到一些引人注目的XML参考,并了解可以比JSON或MySQL(或Web开发人员的其他方面)做得更好的事情,当我应该使用它!
JSON是非常轻量级的,这使它更适合传递数据到前端。 >
XML具有描述性标签(我个人发现)使得以原始格式更容易阅读。
如果我想要从我的程序中加载任何类型的设置文件,我将以XML文件格式。
这是我的想法无论如何,但我相信有更多的深层原因选择一个在另一个。其中我没有足够的经验可以列出:)
然而,我确实找到了几个网站,使一些好点。
http://ajaxian.com/archives/json-vs- xml-the-debate (评论中的一些好点)
http://webignition.net/articles/xml-vs-yaml-vs-json-a-study-to- find-answers /
I'm curious, I've been developing pretty powerful websites/web apps, and I've never learned XML, even odder I've never really felt the need to. It's not like curl or Prepared Statements where, before knowing what they did and how they worked, I had a feeling 'there's got to be an easier way to do this!' or 'there's got to be something designed for this!'.
Currently I work with MySQL and JSON and I don't have this feeling of 'I need to learn that' (XML), this must be wrong!
I'm really interested to hear some compelling arguments for XML, and learn about things which it can do beter than JSON or MySQL (or some other aspect of web dev) and when i should be using it!
JSON is very lightweight which makes it better suited for passing data around to the front end.
XML has descriptive tags that (I personally find) make it easier to read in a raw format. If I wanted to have any sort of settings file that is loaded in from my program, i would have it in an XML file format.
That's my idea of it anyway, but i'm sure there are much more in-depth reasons for choosing one over the other. Of which i am not experienced enough to list :)
However i did find a couple of sites that make some good points.
http://ajaxian.com/archives/json-vs-xml-the-debate (Some good points in the comments)
http://webignition.net/articles/xml-vs-yaml-vs-json-a-study-to-find-answers/
这篇关于什么是XML,我应该怎么使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!