XML Document Example: Valid Catalog with Namespaces
Validate XML code and configuration files for syntax and closed tags offline.
Result
This page opens the XML validator preloaded with a small, well-formed catalog document: an XML prolog, a root element that declares both a default namespace and a prefixed book: namespace, and a single nested item with a title, author and price. The pass result below is computed the moment the page loads, using the same tag-matching logic as any file you paste in yourself.
Namespaces are one of the more error-prone parts of hand-written XML — a missing xmlns declaration, a mismatched prefix, or a colon typo can silently break a document that otherwise looks fine. This example deliberately declares two namespaces on the root element and uses the prefixed form consistently on every child tag, which is the pattern real SOAP payloads, RSS/Atom feeds, and XML-based config formats rely on.
Paste your own XML into the box to check it the same way. If a tag is left unclosed, a closing tag doesn't match the one that was opened, or a quoted attribute is missing its closing quote, the validator reports the exact line — the same class of mistake shown on the mismatched-tag-error preset page.