Skip to main content
100%

Schematron example

✓ Published0🌍 Public
CCliffordAnderson
Last edited May 26, 2014
Created on May 26, 2014

This example demonstrates how Schematron rules enforce document constraints, reporting human-readable diagnostics for missing or invalid data. It shows two validation patterns: one requiring an `authorized` attribute on `author` elements, and another ensuring `date` elements contain valid `xs:gYear` values. The schema uses Schematron’s `rule`, `assert`, and `diagnostics` elements, with XPath expressions like `text() castable as xs:gYear` and `../title/text()` to locate context and produce tailored error messages. The source is an XML file defining validation logic, not a graphical visualization, so no rendering libraries or canvas APIs are used.

AI-generated description

Similar vizzes