XML Transformer makes transformation from JSON to XML.

Take a look at the configuration parameters of the component:

  • Generate Root Element On XML: defines the value of the root element to be added in the generated XML.

  • Output JSON Property: defines the value of the JSON attribute that will receive the XML in the output.

Messages flow

Input

Considering the configurations:

  • Generate Root Element On XML: customers

  • Output JSON Property: output

When the following message is received:

{
"customer": {
"id":1,
"name":"Paul"
}
}

Output

The following output structure is generated:

{
"output": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><customers><customer>
<id>1</id><name>Leandro</name></customer></customers>"
}
Did this answer your question?