Validating text input
The general intent behind this paper is to furnish the reader with a broad overview of both Schematron and its approach to validation.
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.
As the XPath specification [XPath] shows, there are many possible kinds of relationship, known as 'axes'.
While XML does include an ID/IDREF mechanism which allows for cross-referencing between elements, and hence another form of relationships, it only weakly binds those elements.
This is followed by an outline of Schematron and the intended uses which have guided its design.
The Schematron language is then discussed, covering all major elements in the language with examples of their usage.
For example, we may select all Regular grammars, as used in DTDs, can then be viewed as tree patterns where the only available axis is the parent-child axis [Jelliffe1999e].
Full use of tree pattern validation provides the maximum amount of freedom when modelling constraints for a schema.
During the last few years a number of different XML schema languages have appeared as suggested replacements for the ageing Document Type Definition (DTD).
Tree patterns do just that, and XPath provides a convenient syntax in which to express those patterns.
Validation using tree patterns is a two-step process: Both the candidate object selection, and the assertions can be defined in terms of XPath expressions.
The Schematron conformance language for custom implementation is also introduced.
The paper completes with some suggestions of possible future extensions.