Convert XML to JSONL
Turn XML files into JSONL. Each entry of a top-level list becomes one line of compact JSON, and any other value becomes a single line, with values and key order kept.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop XML files on the dialor turn it to pick what to do
XML turned into JSON Lines.Each entry of a top-level list becomes one line of compact JSON.
What you get
One JSONL file. If the XML holds a top-level list, each entry becomes one line of compact JSON, so every line is one object you can read on its own.
Values and key order are kept as they are in the XML.
Anything that is not a list
When the top level is not a list, the whole value becomes a single line. The output is then a JSONL file with one line.
When it fails
A file that cannot be parsed stops with
input_corrupted. This means the XML is not read as a valid document.Other directions
To go the other way, use JSONL to XML. To combine several JSONL files into one, see merge JSONL.
XML and JSONL.What each format is.
The formats
XML
XML documents and data.
- Extensions
- .xml
- MIME type
- application
/xml - Kind
- Text and data
JSON Lines
JSON Lines, one JSON object per line, the format of logs and datasets.
- Extensions
- .jsonl .ndjson
- MIME type
- application
/jsonl - Kind
- Text and data
In your code.The same XML to JSONL conversion through the API, for your app or your agent.
$ cv convert report.xml report.jsonl$ cv convert report.xml report.jsonlQuestions.What people ask about XML to JSONL.
Each entry of a top-level list becomes one line of compact JSON. Any other value becomes a single line.
Yes. Values and key order are kept.
One file.
The file could not be parsed. The conversion stops with input_corrupted when that happens.