XML to JSON component
The XML to JSON component allows you to convert XML files into JSON files.
Configuration
The XML to JSON component has the following basic configuration options:
Force Top Level Object
Specify whether the resulting JSON will start off with a top-most element whose name matches the XML root element.
Options
YesNo(default)
- XML Input
- JSON Output - No
- JSON Output - Yes
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
<person>
<name>John Johnson</name>
<age>19</age>
</person>
<person>
<name>John Foo</name>
<age>30</age>
</person>
<person>
<name>John Doe</name>
<age>30</age>
</person>
</root>
{
"root": {
"person": [
{
"name": "John Johnson",
"age": 19
},
{
"name": "John Foo",
"age": 30
},
{
"name": "John Doe",
"age": 30
}
]
}
}
{
"person": [
{
"name": "John Johnson",
"age": 19
},
{
"name": "John Foo",
"age": 30
},
{
"name": "John Doe",
"age": 30
}
]
}
Skip whitespace
Specify whether white spaces between XML elements will be interpreted as text values or will be ignored.
Options
YesNo(default)
Trim spaces
Specify whether leading and trailing white spaces will be omitted from string values.
Options
YesNo(default)
- XML Input
- JSON Output - No
- JSON Output - Yes
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
<person>
<name> John Johnson </name>
<age>19</age>
</person>
<person>
<name>John Foo</name>
<age>30</age>
</person>
<person>
<name>John Doe</name>
<age>30</age>
</person>
</root>
[
{
"name": " John Johnson ",
"age": "19"
},
{
"name": "John Foo",
"age": "30"
},
{
"name": "John Doe",
"age": "30"
}
]
[
{
"name": "John Johnson",
"age": "19"
},
{
"name": "John Foo",
"age": "30"
},
{
"name": "John Doe",
"age": "30"
}
]
Skip namespaces
Specify whether to remove namespaces from the JSON output. By default they will be added to the JSON output using @xmlns.
Options
YesNo(default)
- XML Input
- JSON Output - No
- JSON Output - Yes
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
<h:table xmlns:h="http://www.dummy.com/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table xmlns:f="https://dummy.com/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
</root>
{
"h:table": {
"@xmlns:h": "http://www.dummy.com/TR/html4/",
"h:tr": {
"h:td": [
"Apples",
"Bananas"
]
}
},
"f:table": {
"@xmlns:f": "https://www.dummy.com/furniture",
"f:name": "African Coffee Table",
"f:width": "80",
"f:length": "120"
}
}
{
"h:table": {
"h:tr": {
"h:td": [
"Apples",
"Bananas"
]
}
},
"f:table": {
"f:name": "African Coffee Table",
"f:width": "80",
"f:length": "120"
}
}