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.

  1. 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.

  2. 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.

  3. When it fails

    A file that cannot be parsed stops with input_corrupted. This means the XML is not read as a valid document.

  4. 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

From · XML

XML

XML documents and data.

Extensions
.xml
MIME type
application/xml
Kind
Text and data
To · JSONL

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.

terminal
$ cv convert report.xml report.jsonl
$ cv convert report.xml report.jsonl

Questions.What people ask about XML to JSONL.

01OF 04

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.

More conversions.Other ways in and out of XML and JSONL.