4 ms·
Very basically, XML is a document format. Inherited from SGML. The point of the statement is to say that all the "clever tricks" that XML permits (entities, en
by lolive 9y ago
Very basically, XML is a document format. Inherited from SGML.
The point of the statement is to say that all the "clever tricks" that XML permits (entities, encoding, well-formedness, validation, ...) make it unsafe to manage by hand.
(I.e by appending strings together to build an XML, or by tokenizing a XML input string).
From there, you need tools and API to manage your XML representation. And mapping technologies to recreate objects in memory from an XML content.
All these (over engineered) tools make things overly complex when you want to exchange documents. And a true nightmare when you exchange data structures.
The alternative of JSON and JSON.parse() is extremely lightweight in comparison. JSON is basically Javascript already. And you can create JSON from any in-memory data structure, with any programming language.
Today, XML should be used only to exchange structured documents. (Which was its primary goal, btw ;)