concept xml in category apache chemistry

appears as: XML, XML
CMIS and Apache Chemistry in Action

This is an excerpt from Manning's book CMIS and Apache Chemistry in Action.

To create a type, you have to provide the type definition and all of its new property definitions. Because that’s generally a repetitious, lengthy, and error-prone piece of code, OpenCMIS provides the TypeUtils class, which can read and write type definitions from and to XML and JSON. The XML and JSON format is the same format that’s defined in the specification to send type definitions over the wire. The simplest way to create a new type is to save an existing type as XML or JSON from the CMIS Workbench (by clicking the Save Type Definition button at the top of the Types screen), edit this file, and then create the new type.

What makes the Browser binding better suited for web applications? First, the underlying data encoding isn’t based on XML but on the JSON protocol (www.json.org). The JSON syntax is oriented closely to the syntax of JavaScript. In theory, a single statement in JavaScript can parse and process a JSON document. This makes parsing and generating JSON a natural and easy task in JavaScript.

Second, JSON is lightweight and far less verbose than XML. This makes it better suited for low-bandwidth connections and mobile applications while still being readable and text-based. The mapping between JSON and the CMIS domain model is direct and straightforward. There’s no overhead from a predefined structure as in AtomPub, and there’s a 1:1 mapping from the CMIS JSON protocol to its domain model. The Browser binding also defines a fixed URL syntax compared to the more flexible approach in AtomPub. From a CMIS consumer perspective, this makes life a lot easier. You don’t have to deal with various possibilities like, for example, how a link is formed to get the content of a document. The URL always looks the same, and the client always uses the same form of URL no matter what repository is used as a back end. The CMIS Browser binding is restricted to the HTTP methods GET and POST. (All browsers on all platforms support GET and POST.)