Schematron is open source, and is (at the time of writing) being migrated to SourceForge to better manage its development by a rapidly growing community of users. Recall that validation is a two step process of identification and followed by assertion. It does not provide a detailed tutorial of the language, although all major elements are discussed, and assumes that the reader is already familiar with XPath, XSLT, and XML DTDs. Simple XML language for illustrative purposes This schema allows us to describe a house consisting of a number of walls and a roof. The Schematron Assertion Language This section introduces the Schematron assertion language which can be used to generate XSLT validators using the Schematron implementation.
All following examples conform to a simple XML vocabulary introduced in the next section. Generating Validators Using Schematron Schematron is therefore a simple layer above XPath and XSLT allowing it to leverage existing tools, and benefit from a framework which is already familiar to XSLT developers. Before discussing the details of the Schematron language it is worth reviewing the design goals which have been highlighted by its author. Writing Rules As noted earlier, constraints must be applied within a context. Tree patterns do just that, and XPath provides a convenient syntax in which to express those patterns.
An assert is used to test whether a document conforms to a particular schema, generating actions if deviations are encountered. The following section outlines the Schematron assertion language which is used to define Schematron schemas. Yet the fundamental approach adopted by these languages does not diverge greatly from the DTD paradigm: the definition of schemas using regular grammars validating software applications.. Assert and Report elements may contain a name element which has an optional path attribute. The general intent behind this paper is to furnish the reader with a broad overview of both Schematron and its approach to validation.