by wicke · 11y ago · 0 comments
I've encountered many poorly written services where I would have been happy if there were a schema to be at least sure what kind of messages are exchanged.
JSON is beloved because it's easy and simply. XML was originally simple too with just DTD as Schema. Then they come up with XML-RPC, XMLSchema, XSLT, SOAP and many other complex concepts that in the end more or less failed.
The complexity of XML has not changed since its inception.
> Then they come up with XML-RPC, XMLSchema, XSLT, SOAP and many other complex concepts that in the end more or less failed.
This doesn't really has any bearing on the specification of XML itself. XML is simple (with some caveats like entity expansion), and extremely flexible. The problem is that it is designed to be read and written by machines, while still being debugable by people. It is extremely verbose. It shines in some use cases, eg for documents with a complex structure and a lot of semantic metadata. But it is even less suitable than JSON for configuration files, for instance.
* it's a little too verbose (<xml></xml>.. while even S-expressions use just ')' as terminator)
* there is no obvious way to transform any xml to an object (pojo is the best aproxymation, but how do you differentiate between a sub-tag, a text node, and an attribute?)
* it's essentially typeless (how do you serialize a number? how to differentiate it from a string? from a boolean?)
http://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/c...
;-)