0

XML Mismatched Tag Error Example: Wrong Closing Tag

Validate XML code and configuration files for syntax and closed tags offline.

Buy Me a Coffee at ko-fi.com
Processing... 0%
Reading XML tags
Parsing prolog structure
Matching XML schemas
Checking namespaces
Validating tree

Result

This page opens the XML validator preloaded with a short note document that contains a real, common mistake: the <message> element is closed with </date> instead of </message>, most likely a copy-paste slip from editing a nearby field. The failing check below runs live the moment the page loads and reports both where the mismatched tag was found and where the tag it should have closed was originally opened.

A mismatched closing tag is one of the most common ways real-world XML breaks, especially in documents edited by hand or generated by string concatenation rather than a proper serializer: every other tag in the file can be perfectly formed, and a single wrong closing tag anywhere still invalidates the whole document, because XML requires a strict, well-nested tree with no exceptions.

Replace the sample with your own XML to see the same tag-matching check applied to it, including line numbers for both the mismatch and the original opening tag. Compare it against the xml-document-example preset to see the same shape of document with every tag correctly closed and passing cleanly.