JSON document size and JSONx document size

Describes the JSON document size and JSONx document size.

The size of the generated JSONx document is larger than the size of the incoming JSON document. The size difference might be significant. Specify an XML Bytes Scanned value in the XML manager of approximately two times the size of the JSON Settings Maximum document size. This increased value accommodates the size of the converted JSONx document.

The JSONx document contains the following parts.
  • XML document declarations (document type and namespaces)
  • For each name-value pair in the JSON document, an XML element with a tag and name attribute

The size of the XML document declarations is fairly constant size. The size of the name-value pairs is more varied. For JSON documents with small names and small values, the converted JSONx document might be two or more times the size of the JSON document. If the JSON document has large values, the size increase is relatively smaller.

To illustrate, consider this simple, 18 character JSON document.
{"label":"value"}
When the JSON document is parsed, it results in the following 289 character JSONx document.
<?xml version="1.0" encoding="UTF-8"?>
<json:object xsi:schemaLocation="http://www.datapower.com/schemas/json jsonx.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:json="http://www.ibm.com/xmlns/prod/2009/jsonx">
  <json:string name="label">value</json:string>
</json:object>

Not counting the XML document declarations, the JSONx transform for the name-value pair is approximately 60 characters.