22 chars · 1 line
Waiting for input
22 chars · 1 line
Waiting for input
XML prolog troubleshooting
The sample emits <!DOCTYPE root> after <root/> has already completed the document element. A DOCTYPE, when present, belongs before the root so it can describe the document type during parsing. This tool is free to use. No account or payment is required.
Last updated
The document type declaration is parsed before the document element. Placing it after the root is structurally similar to appending other forbidden document-level content after the XML tree has ended.
Move the DOCTYPE before the root element.
<root/><!DOCTYPE root><!DOCTYPE root><root/>Common questions
No. Many XML documents do not use a document type declaration.
Before the root element, in the document prolog.
No. This validator checks XML well-formedness rather than DTD validity constraints.
Debugging a specific XML issue? Browse XML troubleshooting.