This tool accepts XML in two formats:
1. A single element:
<name>Alice</name>
2. A list of items:
<people>
<person>
<name>Alice</name>
<age>30</age>
</person>
<person>
<name>Bob</name>
<age>25</age>
</person>
</people>Each item becomes a row in the CSV. The element names become column headers.
The output is a CSV with element names as column headers and each item becomes a row. The result of the above XMLs will be:
Single element output:
name Alice
List output:
name,age Alice,30 Bob,25
Note: By default, this tool displays CSV in a table format for easier reading. Click the 'Raw' button to see comma separated values.
If your XML has empty elements, they will be converted to empty values in the CSV.
<person> <name>Alice</name> <age></age> </person>
becomes:
name,age Alice,
If your XML has attributes, they become columns in the CSV. The column name combines the
element name and attribute name (e.g., id on <person> becomes person_id).
<people>
<person id="1" status="active">
<name>Alice</name>
</person>
</people>becomes:
person_id,person_status,name 1,active,Alice