
XML Versus JSON Versus YAML for Configuration Files
One small config written three ways: size, comments, types and the YAML country code that parses as False. A decision guide for choosing between them.
Tag
59 posts

One small config written three ways: size, comments, types and the YAML country code that parses as False. A decision guide for choosing between them.

How to expand anchors and merge keys in CI files to see the effective job, and the yq 4.54.1 merge-key order bug that gave retries 2 where the spec says 5.

Let partners add their own data to your XML format safely by giving each extension its own namespace, with a reader that ignores what it does not own.

Text and elements side by side look natural in documents and break data models. How ElementTree and lxml expose text and tail, and what to do instead.

XML cannot hold raw bytes. Base64 adds 33 percent, hex adds 100 percent, and both cost memory. Measured sizes, the schema type, and the alternatives.

Wrapper elements, empty versus absent versus nil, and the one-item list trap when XML becomes JSON, all demonstrated with real parser output.

Version attribute or new namespace? Test results show how strict schemas reject added elements and how an extension point lets old readers keep working.

Attributes suit short identifying values, elements suit everything with structure or long text. A test of the whitespace and ordering rules shows why.

Excel risks a data pipeline inherits: formula injection, macros, zip bombs, XML entity attacks, hidden data and weak passwords, with the checks for each.

XML names are case sensitive and follow strict character rules. Compare camelCase, snake_case and kebab-case for elements, with the rules that decide.

How a YAML tag makes a loader build arbitrary objects, with a harmless proof in PyYAML, what safe_load and full_load did with it, and Ruby and Java behavior.

A practical guide to XML format design: names, attributes, lists, optional data, binary, namespaces and versions, with a tested worked example.