Lesson 4
Formatting vs Validation
What each step proves.
Validation checks whether XML is well-formed without changing bytes (except whitespace you choose to ignore in the checker). Use it when a parser error message points to a broken file but you are not ready to reformat yet.
Formatting parses the tree and re-emits indented XML. It helps humans read diffs and spot structural mistakes—but may reorder or drop comments depending on the parser.
| Step | Changes text? | Proves |
|---|---|---|
| Validate | No | Syntax is parseable |
| Format | Yes (layout) | Same after parse (mostly) |
| Minify | Yes (compact) | Same after parse (mostly) |
Validation does not prove:
- Business rules (correct Maven coordinates)
- Schema constraints unless you use XSD separately
- Security (XXE policies depend on parser settings in your app, not this browser tool)
Key takeaway
Run validate before deploy when syntax is suspect; run format before review when syntax is already good but layout is messy.