Skip to main content
Version: 4.17.3

JSON to XML Simple component

The JSON to XML Simple component allows you to convert JSON formatted input into XML output directly.

Configuration

The JSON to XML Simple component has the following configuration options:

Add a root tag?

By default the component won't add a root tag around the resulting XML. Selecting Yes will add a root tag that wraps the XML output.

Options

  • Yes
  • No (default)
JSON root is an array

If the JSON starts with an array, add a root tag to ensure the XML output is valid.

See the example below:

{
"Formula1": {
"Drivers": {
"Driver": [
{
"Age": 19,
"Name": "Max Verstappen"
},
{
"Age": 30,
"Name": "Nico Hulkenberg"
}
]
},
"Teams": {
"Team": [
{
"Principal": "Christian Horner",
"Name": "Redbull Racing"
},
{
"Principal": "Carlos Ghosn, Jérôme Stoll, Cyril Abiteboul",
"Name": "Renault"
}
]
}
}
}

Root tag name

Specify a custom root tag. The default value is root.

note

Only available when Add a root tag? is enabled.

the root name cannot:
  • Start with a digit.
  • Start with special characters such as hyphens or periods.
  • Start with any variation of xml.
  • Contain special characters other than the periods, hyphens, underscores and/or colons.

When a JSON key contains invalid XML characters

Specify whether invalid XML characters should be filtered out when converting JSON keys.

Options

  • Filter these characters
  • Don't filter these characters and go to the error route (default)

By default, the component does not filter invalid XML characters from JSON keys. This may cause errors, directing the exchange to the error route. If you're unsure whether the JSON contains invalid XML characters in the keys, we suggest to enable filtering.

note

Some JSON keys that are never valid as XML elements are automatically prepended with element-.

JSON key characters are filtered when they:
  • Start with a digit.
  • Start with special characters such as hyphens or periods.
  • Start with any variation of xml.
  • Contain special characters other than the periods, hyphens, underscores and/or colons.

See the example below:

{
"Formula1": {
"Drivers": {
"Driver": [
{
"A!ge": 19,
"Na>me": "Max Verstappen"
},
{
"Ag?e": 30,
"Nam<>e": "Nico Hulkenberg"
}
]
},
"Tea#@ms": {
"!Tea!m": [
{
"!@!Principal": "Christian Horner",
"12Name!": "Redbull Racing"
},
{
"45Principa!l": "Carlos Ghosn, Jérôme Stoll, Cyril Abiteboul",
"xmlName": "Renault"
}
]
},
"123": "example"
}
}

Change the name of array elements?

By default, the component uses the name of the JSON key for an array to name the nodes in the resulting XML. Select Yes to override this behavior.

Options

  • Yes
  • No (default)

See the example below:

{
"Formula1": {
"Drivers": {
"Driver": [
{
"Age": 19,
"Name": "Max Verstappen"
},
{
"Age": 30,
"Name": "Nico Hulkenberg"
}
]
},
"Teams": {
"Team": [
{
"Principal": "Christian Horner",
"Name": "Redbull Racing"
},
{
"Principal": "Carlos Ghosn, Jérôme Stoll, Cyril Abiteboul",
"Name": "Renault"
}
]
}
}
}

Array element name

Specify a custom name for array elements. The default value is element.

note

Only available when Change the name of array elements? is enabled.

the array element name cannot:
  • Start with a digit.
  • Start with special characters such as hyphens or periods.
  • Start with any variation of xml.
  • Contain special characters other than the periods, hyphens, underscores and/or colons.
Last update on Feb 24, 2025