Formats
XML ↔ JSON
Convert between XML and JSON formats.
How to use it
- Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type XML ↔ JSON and press Return.
- Choose To JSON or To XML at the top.
- Paste or type your text into Input.
- Adjust the Options on the right if you need to. The defaults are listed below.
- Press To JSON, or ⌘↵.
- To go the other way, press Swap or ⌘S. The output moves into the input.
- Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.
Options
| Option | Values | Default |
|---|---|---|
| Indent SpacesNumber of spaces for indentation | 1–8 | 2 |
| Attribute prefixPrefix for XML attributes in JSON | @, _, $attr_, none | @ |
| Text content keyKey name for text content | #text, _text, $value, _ | #text |
Example
Real output from Devly, with the default options.
Input
<app><name>Devly</name><version>2.3.0</version><offline>true</offline></app>
{
"app" : {
"name" : "Devly",
"offline" : "true",
"version" : "2.3.0"
}
}From Terminal
With the free command-line tool installed:
Terminal
devly xml2json --path input.txt # or pipe text in pbpaste | devly xml2json
Quick Switch also finds it by: xml, json, convert, transform.
More Formats tools
JSON FormatterFormat, validate, and minify JSON with syntax highlightingJSON Path QueryQuery JSON data using JSONPath expressionsJSON ↔ YAMLConvert between JSON and YAML formatsYAML FormatterFormat, validate, and beautify YAML documentsXML FormatterFormat, validate, and beautify XML documentsCSV → JSONConvert CSV data to JSON format