Convert BSON to XML

Turn BSON files into XML. Objects become elements inside one root element and every value becomes text, with characters a tag name cannot hold turned into underscores.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop BSON files on the dialor turn it to pick what to do

BSON documents as readable XML.Each document becomes elements under one root, with every value written as text.

  1. What you get

    One XML file. Objects become elements inside a single root element, and every value is written as text. Characters that a tag name cannot hold are turned into underscores.

    ObjectIds become hex text, dates become ISO 8601 text and binary data becomes base64.

  2. How keys and lists map

    Keys that start with @ become attributes. Lists and objects placed in an attribute are written as JSON text. A key named #text becomes the element's own text.

    A list repeats its element, once for each item. An empty list therefore disappears, and a list of lists is flattened into one run of elements.

  3. When it stops

    If the file cannot be parsed, the conversion stops with input_corrupted. The BSON file is damaged or is not valid BSON.

    To go the other way, use XML to BSON.

BSON and XML.What each format is.

The formats

From · BSON

BSON

MongoDB's binary document encoding, JSON with dates and binary fields.

Extensions
.bson
MIME type
application/bson
Kind
Text and data
To · XML

XML

XML documents and data.

Extensions
.xml
MIME type
application/xml
Kind
Text and data

In your code.The same BSON to XML conversion through the API, for your app or your agent.

terminal
$ cv convert report.bson report.xml
$ cv convert report.bson report.xml

Questions.What people ask about BSON to XML.

01OF 04

No. Every value becomes text. Dates are written as ISO 8601 text, and ObjectIds as hex text.

Binary data is written as base64 text.

A list repeats its element once per item. With no items, no element is written.

Start the key with @ in the BSON document. That key becomes an attribute on its element.

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