Convert ENV to XML

Turn ENV 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 ENV files on the dialor turn it to pick what to do

Your ENV settings as an XML file.Each key becomes an element, and each value becomes text.

  1. What you get

    One XML file. The keys from your ENV file become elements inside a single root element, and every value is written as text.

    A character that a tag name cannot hold in a key is turned into an underscore.

  2. Attributes and text

    A key that starts with @ becomes an attribute. When its value is a list or an object, the attribute holds that value written as JSON text. A key named #text becomes the element's own text.

  3. What changes

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

    To go the other way, use XML to ENV.

ENV and XML.What each format is.

The formats

From · ENV

Dotenv

KEY=value lines that hold environment variables for an app.

Extensions
.env
MIME type
text/x-env
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 ENV to XML conversion through the API, for your app or your agent.

terminal
$ cv convert report.env report.xml
$ cv convert report.env report.xml

Questions.What people ask about ENV to XML.

01OF 04

Yes. The objects become elements inside one root element.

They are turned into underscores in the element name.

No. Every value becomes text.

It disappears. A list repeats its element once per item, so an empty list leaves nothing behind.

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