
A schema, in our case a RELAX-NG schema, is a formal specification of an XML vocabulary (the allowed tags and attributes), and how they relate to each other. So, for example, the restrictions that say you cannot nest a <book> inside of a <chapter>, nor can you nest a <subsection> in a <chapter> without an intervening <section>, are expressed and enforced by the schema. One of the beauties of the schema is that it is written using a very specific syntax and then there are tools that use a schema as input. In particular, a PreTeXt source file that conforms to the PreTeXt schema is said to be valid. You should strive to always, always, always have valid source files, and therefore you want to regularly verify that this is the case.
You can find the PreTeXt schema in the schema directory. The version we author and maintain is pretext.xml, which is used to create pretext.rnc, which uses the compact syntax of the RELAX-NG specification. By providing the schema and your source to a program called a validator you can check if your source is valid, and if not, why. See Chapter 5 for the details on doing this.