I am working on creating a new implementation of a service that is ~10 years old. Our standard is to have our services be strictly RESTful accepting, preferably son format. The current implementation accepts cXML. Is there anything about that format that is not portable to son? I'm not familiar with cXML at all.
-
1Are you prepared to pay all of your trading partners to retool to your new solution? CXML is a well-known format in a number of sectors, particularly travel and procurement. Version 1.0.33 just came out. Just my .02, but I expect that upon querying whoever you're trading CXML with will tell you it will be a heavy lift for them and may take months if they'll do it at all without you compensating them. We like standards for good reasons. – MrGadget Mar 17 '17 at 13:39
-
Typo above...version 1.2.033. – MrGadget Mar 17 '17 at 14:02
1 Answers
cXML is just an XML implementation. As you can read in official documentation (http://xml.cxml.org/current/cXMLUsersGuide.pdf, page 22):
Each cXML document is constructed based on XML Document Type Definitions (DTDs). Acting as templates, DTDs define the content model of a cXML document, for example, the valid order and nesting of elements, and the data types of attributes.
On the other hand json is schema free and self-describing format. You don't need an external schema or definition to interpret JSON data. Because of this you don't need to worry about any portability issues.
Also, take a look at this: https://github.com/ncbi/DtdAnalyzer/wiki/Auto-generating-XML-to-JSON-conversion-XSLT
This tool can help you with preparing how your JSON structure should look like in your case (I did not check it, output probably will be messy, but still could give you some overview)

- 236
- 1
- 10
-
"you don't need to worry about any portability issues": isn't that a bit naive? – Henry Mar 08 '17 at 20:12
-
1To be honest - no it's not :) XML is very strict format. It must follow DTD schema directly. As this still is nothing more than XML it will consist only from particular tag names, values of tags and attributes (Values of course can be either simple value or another tag/tags). In this in mind one can take DTD schema and simply migrate it to some json fromat. Thing that is challenging in such case could be implementation of endpoints that will consume json request in same manner that previous system consumes xml. But this will be more case-specific. – Daniel Pokusa Mar 08 '17 at 21:00