A validator is a computer program that checks the syntactic correctness of a document. The term is often used with respect to markup languages . Concrete validators can check with an XML schema, for example, the syntax of HTML documents or the conformity of an XML document.
Types of validators
In general, two types of validators can be distinguished:
- Validators for a standard (eg HTML validator )
- Validators which are controlled by a schema
In the case of XML validation, the two types can be distinguished. In the first case (test against the XML standard ) is spoken of well-formedness and in the second case (test against a schema ) validation.
In practice, a Validator should not only detect if a document is not valid, that is a standard or scheme does not comply, but also point to possible causes. Validators can also be used to, only to point out possible errors, for example in the case of an automatic spell checker. As this example shows, it can also happen that a Validator not the full standard ( here: the rules of the German language ) covers, but only detects some errors.