What this tool does
Keys become elements, values become their contents.
user:
name: Ada
born: 1815
<user>
<name>Ada</name>
<born>1815</born>
</user>
A document with several keys at the root is wrapped in <root>, because XML allows exactly one root element.
Keys are repaired, not emitted broken
An XML element name may not contain a space, may not start with a digit, and is limited to a specific set of characters:
| key | element |
|---|---|
user name | <user_name> |
2nd | <_2nd> |
user-name | <user-name> (already legal) |
Writing the key as it stands would produce a file that looks like XML and that no parser will accept — the kind of output that fails much later, somewhere else.
Two keys that repair to the same name
user name and user_name both want to be user_name. The second becomes user_name_1.
The alternative is to let one overwrite the other, and a value disappearing without a word is exactly what this tool tries not to do.
Lists become repeated elements
items:
- 1
- 2
<items>
<item>1</item>
<item>2</item>
</items>
XML has no list type; repetition is the list. The name item has to come from somewhere, and nothing in the YAML offers one.
Attributes, if you want them
A key spelled "@_id" becomes an attribute, and "#text" becomes the element’s text:
"@_id": 1
"#text": hello
<root id="1">hello</root>
That is the convention the XML-to-YAML direction emits, so the round trip keeps its shape.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.