Version: 17.07
Supported Since: 17.01
A CSV to XML Transformer is a processing element which transforms a CSV 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 order to use this processing element, you must first select the Message Transformation dependency from the processor list when you are creating an empty Ultra project. If you have already created a project, you can add this dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Processors list, select the Message Transformation dependency. |
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. |
||
Row element name * |
Basic |
This parameter will be used as the name of the element that encloses the elements of each row. For example refer the following sample CSV content.
Notice that in the following converted XML output, data for each row is enclosed inside a tag named row_element, which is the value of this parameter.
|
||
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. |
||
Allow single column * |
Basic |
Specifies whether to allow transforming single column CSV files. If this is set to true, the transformer will attempt to transform even the payloads that has been recognized to have only one CSV column. Otherwise the transformer will fail at such kind of payloads. The default value of this parameter is set to false.
|
In the following use case, the requirement is to read a message with a CSV 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 CSV 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 CSV to XML successfully, the message with the transformed payload is handed over to the SFTP egress connector, as the "Next" outport of the CSV 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 CSV to XML Transformer is connected to a Logger processing element, followed by an Exceptional Flow End element.