JSON XML Conversion (com.soa.jsonxml)

JSON XML Conversion Configuration

JSON Array Element Name (json.xml.mapper.elementName)

Establishes a default XML element name for all un-named JSON array elements. This is for JSON to XML conversion only.

Default: element

Force Top Level Object (json.xml.mapper.forceTopLevelObject)

Indicates whether the root XML element should be a named JSON object inside an outer set of {}'s or treated anonymously as the root JSON object represented with the outer {}'s. For example, if true the XML string ab1/b/a will become { 'a' : { 'b': 1 } }. If false the same XML string will become { 'b': 1 }. This is for XML to JSON conversion only.

Default: false

Ignore Namespaces (json.xml.mapper.ignoreNamespaces)

Indicates whether namespace declarations should be converted to JSON attributes or not (ignored entirely). This is for XML to JSON conversion only.

Default: true

Remove Namespace Prefixes (json.xml.mapper.removeNamespacePrefixes)

Indicates whether namespace prefixes in XML element names should be removed when generating JSON names or not. This is for XML to JSON conversion only.

Default: true

Use ParentPrefix (json.xml.mapper.useParentPrefix)

Indicates whether prefixes from parent XML elements should automatically be applied to children elements or not. By default namespace prefixes are not added. The input JSON names must have the prefixes in them already. If the input JSON names do not have namespace prefixes and the goal is to have them in the resulting XML then either changeObjectName() must be called for each JSON name without a prefix or use this setting or both. By setting this to true when an XML element is created, if the parent XML element has a prefix it will automatically be added to the new element. This is for JSON to XML conversion only.

Default: false

Expand Named Arrays (json.xml.mapper.expandNamedArrays)

Indicates whether to automatically expand from child to parent all named array elements. For example, by setting to true the JSON structure of { 'a' : { 'b' : '1', '2' } } will result in XML of ab1/bb2/b/a and a setting of false will result in XML of abe1/ee2/e/b/a where 'e' is controlled by {@link setElementName(java.lang.String}. The array must be named ('a' in this case) so the name can be used for the element names. This is for JSON to XML conversion only.

Default: false

Create Array Objects (json.xml.mapper.createArrayObjects)

Indicates whether an outer JSON object using the name of the XML elements used as the array contents should be created. For example if the input XML is ab1/bb2/b/a with this setting false the output JSON would be { 'a' : 1, 2 }. With this setting true the output JSON would be { 'a' : { 'b' : 1, 2 } }.

Default: false