English 中文(简体)
XML对使用它有什么好处?
原标题:What is XML good for and when should i be using it?

我很奇怪,我正在开发极强大的网站/网站,我从未学过XML,甚至我也从未真正感受到过需要。 它不喜欢曲折或编写声明,在知道他们做什么和如何工作之前,我感觉到,这样做会比较容易! 或者说,这是为了什么。 。

目前,我与我的SQL和JSON合作,我没有这样的感觉,那就是,我必须知道(XML),这必须是错误的!

我真切希望听到一些令人信服的XML论点,并了解它所能做的事情,而不是JSON或MySQL(或网络发展的其他一些方面),以及何时应该使用它!

最佳回答

JSON非常轻重,因此更适合将数据放在前端。

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.

这是我对它的想法,但我确信,选择一个方面有更深入的理由。 其中,我没有经验可以列举:

然而,我确实找到了几个好点的地点。

(评注中的一些要点)

http://webignition.net/articles/xml-vs-yaml-vs-json-a-study-to-find-answers/“rel=“noreferer”>http://webignition.net/articles/xml-vs-yaml-vs-json-a-study-to-find-answers/

问题回答

XML对于储存异质的树木结构非常有用,因为在这种情形下,一般用途工具可以应用到这些工具,而且有些多余。 如果你进行现代网络开发,那么你就有一个很好的机会来生产X超文本而不是超文本,并且正在生产RSS或Atom,因此,你本应该加以利用。 最常见的区域发展框架格式使用。

JSON公司很容易在网上查阅数据,但网 t也一样,在JSON中,你没有属性,因此数据与元数据之间不存在任何隐性差别,而且你没有处理指令,也没有能力为重复的文.创建实体。 另一方面,许多使用XMLl的做法也不使用这些特征。 结构数据库有固定的图象,并不代表树木。

大部分XML用于互操作性。

XML相对于其他序列化格式的优势之一是现有工具的数量。 另一种是能够正式描述你的数据(XML Schema)。

可用的工具使你能够使用XML编辑、变压器、视力器...... 例如,在我工作的地方,我们设有通信小组,利用XML编辑编辑编辑编辑编辑编辑编辑编辑内容和元数据。 它们不够技术性,无法用手写JSON(或XML),但很容易给他们一个带有通用字塔的模板,以编辑所需文件。

为了描述格式(XSD, DTD, Relax NG,......),你也可以自动验证你的文件。 该文件还很好地记录了你的文件中允许的内容和内容。

XML只是以一种结构化的方式储存信息,即(明显)应用神学。 这就是说。 另一种方式是,XML提供了一种方法,用以在不同应用之间进行通信时保存数据学(分析)。 它还是一个组合格式,因为(1) 组合文件只是不同应用会议之间的信息* ,(2) 几乎所有语文都成熟,标准XML图书馆。

* 您也可认为这只是申请之间沟通的淡化案例。

我将XML用于翻译网站标签、标签等或非重复内容。 对这种事情来说,它夺去了生命。

我将XML主要用于编织档案或作为运输格式,然而,如果你熟悉JSON,或YAML,它们可能与你一样是罚款,因此没有必要学习XML。

XML只对数据交换和任何其他东西都有利。

因此,只有你gon子或提供RSS的饲料,你才能学习XML。 但是,没有使用火箭科学,因为其标记语言与超文本一样,而且有一些严格的准则。

Stack Overflow的创建人提供优良文章,以分类

“了解XML”可能意味着几个不同的东西。

第一是了解基本合成物。 这是撰写XVD、SVG、Atom、RSS和许多其他语文(XML)申请的前提条件。

第二种是建立在第一个基础上的,是了解如何开发自己的XML应用,即海关数据储存或交换格式。 JSON可以发挥类似的作用,并具有一些优势(例如能够暗中代表一系列数据:{条:[ foo] }。 在XML中,如果希望将其视作简单数据结构的话,教区必须知道将<条码>和代号;bar><foo/></bar>和不利条件(XML使你可以选择某些事情,但努力较少)。





相关问题
The Fastest DataStructure to Filter with in C#

Currently we are filtering and sorting data with a datatable. /// <summary> /// Filters the data table and returns a new data table with only the filtered rows. /// </summary>...

Efficient queue in Haskell

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: ...

Java large datastructure for storing a matrix

I need to store a 2d matrix containing zip codes and the distance in km between each one of them. My client has an application that calculates the distances which are then stored in an Excel file. ...

Holding onto items after a postback

I have an ASP.NET web application and I want to be able to take items from a master list and store them temporarliy into one of four other lists. The other lists need to survive post backs so that ...

negative number in the stack

I am a new student in the compilers world ^_^ and I want to know is legal represent negative number in the stack. For example: infix: 1-5=-4 postfix: 15- The statements are: push(1) push(5) x=...

What type of struct/container would you use in this instance?

I am trying to figure out what type of structure or container I should use for a quick project. I need to have an unknown number of sets that will be entered from the GUI (each one will have a name, ...

热门标签