| schema | ||
| count(*) = count(pattern) | A schema element should contain only pattern elements. | |
| pattern | A schema element should contain at least one pattern element. | |
| pattern | ||
| count(*) = count(rule) | A pattern element should contain only rule elements. | |
| rule | A pattern element should contain at least one rule elements. | |
| @name | A pattern element should have an attribute called name. | |
| rule | ||
| count(*) = count(assert | report) | A rule elemement should contain only assert and report elements. | |
| assert | report | A rule elemement should contain at least one assert or report elements. | |
| @context | A rule element should have an attribute called context. This should be an XPath for selecting nodes to make assertions and reports about. | |
| assert | ||
| @test | An assert element should have an attribute called test. This should be an XSLT expression. | |
| report | ||
| @test | A report element should have an attribute called test. This should be an XSLT expression. | |
| pattern | ||
| parent::schema | A pattern element should be within a schema element. | |
| string-length(@name) > 0 | A pattern element's name attribute should contain some text. | |
| count(rule) > 4000 | Warning: This implementation of The Schematron only allows 4000 rules per pattern. Split the current pattern into two. | |
| rule | ||
| parent::pattern | A pattern element should be within a schema element. | |
| string-length(@context) > 0 | A rule element's context attribute should contain an XPath. | |
| assert | ||
| parent::rule | An assert element should be within a rule element. | |
| string-length(@test) > 0 | An assert element's test attribute should contain an XPath expression. | |
| string-length(text()) > 0 | An assert element should contain some explanatory text. | |
| report | ||
| parent::rule | A report element should be within a rule element. | |
| string-length(@test) > 0 | A report element's test attribute should contain an XPath expression. | |
| string-length(text()) > 0 | A report element should contain some explanatory text. | |
| schema | ||
| ancestor::schema | A schema cannot contain a schema | |
| rule[@context="html"] | ||
| * | This schema seems to be for HTML. | |
Schematron Pretty by Rick Jelliffe. The Schematron by Rick Jelliffe, Academia Sinica Computing Centre.