json-tools .ru

XML to YAML

Parses an XML document and outputs it as YAML — more compact and easier to skim than closing XML tags.

What happens to attributes

An XML element's attributes (id="42", for example) end up under a key named @attributes in the YAML — that key name itself gets quoted because it starts with @ rather than a letter.

String-typed attribute values

Attribute and text values in XML are always strings, so available="true" stays the quoted string 'true' in the YAML rather than the unquoted boolean true.

Format
XML → YAML
Source text Paste text or upload a file
Result Type is not detected yet
Statistics appear after formatting