Paritian

Developers

XML Validator

Checks that an XML document is well formed and says which tag broke it.

Results

Verdict valid
Tags 3
Nesting depth 3
Size before 68 B

What this tool does

The commonest XML failure is a tag that never closes, and the second commonest is tags that close in the wrong order. Neither is visible when the document is one long line. This walks the whole thing keeping a stack of what is open, and when a closing tag does not match what is on top it says both names — the one it expected and the one it found — which is usually enough to spot the mistake immediately.

Formula

checks that every tag opened is closed, and in the right order

Variables

SymbolMeaningUnit
textXML
VDVerdict
TGTags
DPNesting depth
SBSize beforeB

Worked example

  • XML<catalogo><livro id="1"><titulo>Os Maias</titulo></livro></catalogo>
  • Verdictvalid
  • Tags3
  • Nesting depth3
  • Size before68 B

Limitations

  • The calculation runs entirely in your browser. The values you type are never sent to a server.

Frequently asked questions

Is well formed the same as valid?

No, and the distinction matters. Well formed means the syntax is right: every tag closes, they nest in the correct order, attributes are quoted. Valid means the document also obeys a schema — a DTD, an XSD — that says which elements may appear where and what they must contain. This checks well-formedness, which is the part that fails ninety-nine times out of a hundred. Checking against a schema needs the schema, and that is a different job.