Skip to main content


developerWorks  >  XML  >

Schematron

Express an XML vocabulary as a series of simple rules

developerWorks

Level: Intermediate

Contributors: ISO

06 Feb 2007
Updated 25 Apr 2007

Schematron is a rules-based XML schema language used to define and limit XML vocabularies. Discover the benefits of using the Schematron standard, either on its own or in conjunction with other schema languages.

The Schematron Assertion Language (this link is to a zip file, which is, unfortunately, the only way to obtain this ISO standard text) [ISO standard ISO/IEC 19757-3:2006] is a schema language that uses a different approach from Document Type Definition (DTD), RELAX NG, or W3C XML Schema (WXS). In Schematron, you register a collection of rules against which the XML document is to be checked, rather than mapping out the entire tree structure of the XML format you're trying to express from root node to the leaves. This makes Schematron useful not only as a standalone schema language, but also as a complement to other schema languages. It also features constraints that you can express in Schematron that you cannot express in other languages. A common example is a co-occurrence constraint, where the constraint on one part of a document depends on another. For example, a constraint of the maximum value of a day field within an element representing a date would depend on the month, and even year, fields. WXS offers no way to express such constraints, and RELAX NG offers limited capability. Schematron allows you to express such constraints quite readily.


Resources


Back to top


Document options

Document options requiring JavaScript are not displayed