Well-formed vs valid
Well-formed means the syntax is correct: one root element, every tag closed, properly nested, attribute values quoted, and special characters escaped. Valid additionally means the document matches a DTD or XML Schema. This tool checks well-formedness with the browser's DOMParser.
Common XML errors
| Problem | Example | Fix |
|---|---|---|
| Unescaped & | <a>Q&A</a> | Write & |
| Mismatched tags | <b><i></b></i> | Close in reverse order |
| Two root elements | <a/><b/> | Wrap in one parent |
| Unquoted attribute | <a id=1> | id="1" |