Links

XML Transformer

Know the component and how to use it.
XML Transformer transforms a JSON object into a XML string.
Take a look at the configuration parameters of the component:
  • Output JSON Property: defines the value of the JSON attribute that will receive the XML in the output.
  • Generate Root Element On XML: defines the value of the root element to be added in the generated XML.

Messages flow

Input

A JSON object is expected to be converted, provided that the component's parameters are correctly filled in.

Output

An XML string that is the result of the conversion of the input JSON object.

XML Transformer in Action

Input

Considering the configurations:
  • Output JSON Property: output
  • Generate Root Element On XML: customers
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>"
}