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.

StepChanges text?Proves
ValidateNoSyntax is parseable
FormatYes (layout)Same after parse (mostly)
MinifyYes (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.

When you want to practice, use the related DevCove tool — optional, not part of this lesson.

Open related tool

Back to course overview