Schema Languages

A grammar-based schema language, such as DTD or Relax NG, declares the grammar for an XML document. It defines the permissible structures, contents, and orders of the elements, attributes, and entities.

A rule-based schema language, such as Schematron, specifies the relationships that must hold for the values of elements and attributes.

Very expressive, XSD is both grammar-based and rule-based.
Expressive power vs ease of use for DTD, Relax NG, Schematron, and XML Schema

An XML document that conforms to the schema defined in a schema language is said to be valid.

An XML document can be validated online using tools such as: Offline validation tools include:
This chapter covers the following schema languages: