简体   繁体   中英

cXML equivalent in json?

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM