Well-formed XML
A well-formed XML Document has to follow several generic rules, such as:
|
• | The XML Document may only have one root element (<book>...</book>). |
• | All tags have an ending tag or are themselves self-ending (<author>...</author> or <author/>). |
• | Tags never overlap, so this arrangement would produce an error: <author><name>...</author></name>. |
It is important to make an XML Document well-formed. In fact, W3C doesn't consider an XML Document to be XML unless it is well-formed. If the XML Document contains a reference to a schema (e.g., a DTD, Relax NG Schema, Schematron or an XSD), it's better to validate the XML Document.
How to check the well-formedness of an XML Document
To check the well-formedness of any DTD, Relax NG Schema, Schematron, XSD or XML Document:
Open your XML Document in the XML Editor.
Click XML > Check Well-formedness.
The Errors view is automatically displayed to show any errors in the document. Click on the error message to jump to the position where the error occurred.
See Also