Version: 17.01
Supported Since: 17.01
A JSON to XML Transformer is a processing element which transforms a JSON message payload to an XML payload. This transformation is done based on a generic set of rules and hence this processing element is most suitable for simple transformations. For complex transformations based on custom rules, Adroitlogic Data Mapping Tool is recommended.
In the following use case, the requirement is to read a message with a JSON payload from a SFTP server, convert the message payload to XML and then deliver it to another SFTP endpoint.
In this flow, the "Processor" outport of SFTP ingress connector is connected to the inport of the JSON to XML Transformer so that the SFTP message received by the connector is handed over to the transformer next. If the processing element is able to transform the payload from JSON to XML successfully, the message with the transformed payload is handed over to the SFTP egress connector, as the "Next" outport of the JSON to XML Transformer is connected to it.
In the case of transformation failure, a log will be generated and then the message flow will complete in an exceptional state, as the "On Exception" outport of the JSON to XML Transformer is connected to a Logger processing element, followed by an Exceptional Flow End element.
Next |
The message will be sent to this outport if the payload transformation is completed successfully |
On Exception |
The message will be sent to this outport if the processing element failed to transform the payload due to some reason |
Root element name * |
Basic |
This parameter will be used as the name of the root element of XML output. |
Array element name |
Basic |
In case of JSON input has an array as the first level element, the value of this parameter will be used as the name of the xml tag that encloses each array element. This is an optional parameter and the default value is "element". |
Namespace prefix |
Basic |
Optional namespace prefix to be used for the XML output. |
Namespace URI |
Basic |
Optional namespace URI for the XML output. If a value for the namespace prefix is specified, it is mandatory to specify a value for this parameter as well. |