From Handwiki XML validation is the process of checking a document written in XML (eXtensible Markup Language) to confirm that it is both well-formed and also "valid" in that it follows a defined structure. A well-formed document follows the basic syntactic rules of XML, which are the same for all XML documents.[1] A valid document also respects the rules dictated by a particular DTD or XML schema.[2] Automated tools – validators – can perform well-formedness tests and many other validation tests, but not those that require human judgement, such as correct application of a schema to a data set.
An XML document must be well-formed before it can be validated. A well-formed document conforms to the syntax rules defined by the XML specification, including proper nesting of elements, matching start and end tags, and correct attribute syntax.[1]
Validation is a separate process in which a well-formed document is evaluated against a schema language such as a Document Type Definition (DTD), XML Schema, RELAX NG, or Schematron to determine whether it conforms to the required document structure and constraints.[2]
A document may therefore be well-formed but not valid if it satisfies the syntax requirements of XML while failing to meet the constraints defined by its associated schema.
Several schema languages and validation standards have been developed for XML.[2]
![]() |
Categories: [XML] [Data modeling languages]