Configuration parsers are where quoting rules bite. YAML reads an unquoted yes as a boolean and 1.2.3 as a string; XML needs & escaped; TOML wants everything quoted. Generating the same records in all four shows exactly where each format differs.
What you can control
- Four formats from one field list, so you can compare how the same record is expressed.
- YAML scalars are quoted only when the value would otherwise be misread — the rule most hand-written YAML gets wrong.
- XML escapes ampersands and angle brackets, and arrays become repeated
<item>elements. - Java properties output flattens everything to
entity[0].field=value, matching how Spring reads indexed properties.
Testing ideas
- Parsers. Generate the same records in XML, YAML, TOML and
.propertiesand run each through your config loader or import job. - YAML gotchas. Check how your parser treats values like
no,onand1e3, which YAML 1.1 parsers read as booleans and numbers. - XML escaping. Names with ampersands and apostrophes test entity escaping in your XML pipeline.
- Declarations. Toggle the XML declaration and YAML document marker to test parsers that are strict about them.
What this is not
The XML output has no namespace or schema declaration. Add an xsi:schemaLocation yourself if you are testing schema validation.