How is XML a general data format?

六眼飞鱼酱① 提交于 2019-12-23 03:09:58

问题


We can use any tag of our choice in XML. If we have a DTD and style associate with it, we can parse it in browser. We can transfer data in XML format.

But if XML tags are not fixed like HTML, how two systems come to know each other's meaning of the tags while talking (ex web services)?

How can XML be a general data exchange language on the vast Internet??


回答1:


XML is a general language but pretty much any communication using XML will use a specific XML application such as XHTML, RDF, Atom, RSS, Office Open XML and so on.

XML is a general way to create specific data formats, not to allow completely arbitrary systems to communicate with each others.




回答2:


The sender and the receiver need to have a shared understanding of the meaning of the element and attribute names. That is why there are many standardized XML vocabularies, e.g. FPML for financial transactions or MusicXML for musical notation; it is in such standards that these meanings are defined.




回答3:


XML is all about agreement. This agreement can come at different levels:

  • By itself, XML provides a syntactical basis for agreement. By agreeing to adhere to the basic rules provided by the XML Recommendation, parties can be assured of a minimal level of mutual understanding at a syntactical level.
  • Along with a schema, XML provides a grammatical basis for agreement. By agreeing to adhere to the grammar provided by a schema, parties can be assured of a minimal level of mutual understanding at a higher structural level.
  • Along with implied or explicit understanding concerning the meaning of the lower XML levels, XML provides a semantic basis for agreement. The form of this understanding can be conveyed implicitly via naming alone, explicitly via documentation, or operationally via the effects of manual or automated processes that use the XML.

XML's success at each of these levels is evident in the multitude of tools, schemas, and industrial standards that are built on XML.



来源:https://stackoverflow.com/questions/29743293/how-is-xml-a-general-data-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!