Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Supported XML and JSON Conversion : Null and Empty Values Conversion Rule

Null and Empty Values Conversion Rule
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON offers the capability to convert elements whose values are null or empty between XML and JSON. Both Badgerfish conversions and normal conversions are in line with the following rules:
Mapping from XML Data to JSON Data
The null and empty values conversion rules for mapping data from XML to JSON is shown in Table 7.
An empty XML element1
{"a":" "} or {"a":{"$":" "}}

1
If the Java Classes schema type is used, the converted JSON data must be {"a":""}.

2
When converting an XML element with whitespace text node to JSON data, as for the converting result, the Badgerfish conversion rule is different from the normal conversion rule:

Mapping from JSON Data to XML Data
The null and empty values conversion rules for mapping data from JSON to XML is shown in Table 8.
A JSON element with a null value1

1
If the Java Classes schema type is used, the converted XML data should be <a>null<a/>.


Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved