Convert TOML to XML
Turn TOML 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 TOML files on the dialor turn it to pick what to do
TOML as XML, in one file.Tables become elements inside a single root element, and every value is written as text.
What you get
One XML file. Each TOML table becomes an element inside one root element, and each value becomes the text of an element. Numbers and booleans are written as text too.
Dates and times become ISO 8601 text. A list repeats its element once for each item.
Attributes and text
A key that starts with @ becomes an attribute. When the value of that key is a list or a table, it is written as JSON text. A key named #text becomes the element's own text.
What changes or is dropped
Characters that a tag name cannot hold are turned into underscores in the element name.
Comments are dropped. An empty list disappears, because a list is written by repeating its element and there are no items to repeat. A list of lists is flattened into one run of repeated elements.
When it stops
A TOML file that cannot be parsed stops the conversion with
input_corrupted. To go the other way, use XML to TOML.
TOML and XML.What each format is.
The formats
TOML
TOML configuration files, the format of Cargo and pyproject.
- Extensions
- .toml
- MIME type
- application
/toml - Kind
- Text and data
XML
XML documents and data.
- Extensions
- .xml
- MIME type
- application
/xml - Kind
- Text and data
In your code.The same TOML to XML conversion through the API, for your app or your agent.
$ cv convert report.toml report.xml$ cv convert report.toml report.xmlQuestions.What people ask about TOML to XML.
No. Every value becomes text in the XML file.
They are dropped. Only the keys and values are written.
If its value is an empty list, the key disappears. A list is written by repeating its element, so an empty list gives no elements.
Use XML to TOML. It is a separate conversion.