 | Level: Introductory Uche Ogbuji (uche.ogbuji@fourthought.com), Consultant and Co-Founder, Fourthought
02 Sep 2004 Meet Schematron, a schema language that allows you to directly express rules without creating a whole grammatical infrastructure. Schematron is useful whenever you wish to apply and check against rules for the contents of XML documents. Schematron is extraordinarily flexible in the variety of rules you can express, and it's even more expressive than other schema languages such as DTD, W3C XML Schema (WXS) and RELAX NG. In this tutorial, author Uche Ogbuji uses detailed examples to illustrate Schematron's use, and offers recipes for common schema needs.
Prerequisites
This tutorial is for developers of XML-based applications who want a way to be sure that all XML instances follow certain rules. Many people immediately turn to schema languages such as DTD, W3C XML Schema (WXS), and RELAX NG. The best solution might be to apply simple rules to XML instances. Schematron is a language that allows you to directly express rules without creating a whole grammatical infrastructure. If you develop XML vocabularies and software that uses XML, learn Schematron. Then, if you already use schema languages such as RELAX NG and WXS, you can augment them with Schematron rules, which are more general and more flexible. This tutorial assumes knowledge of XML, XML Namespaces, and XPath. You will also find it helpful to have some knowledge of XSLT, at least the basics of how to declare and apply templates. If you aren't familiar with these technologies, start with these tutorials "Introduction to XML" (http://www.ibm.com/developerworks/edu/x-dw-xmlintro-i.html) and "Get started with XPath" (http://www.ibm.com/developerworks/xml/edu/x-dw-xxpath-i.html)
System requirements
You will need JavaScript enabled in your browser. To follow along with the examples in this tutorial, you'll need to use a Schematron tool:
- When writing this tutorial, the author used the Scimitar implementation of ISO Schematron (http://uche.ogbuji.net/uche.ogbuji.net/tech/4Suite/scimitar/).
- Other tools are available from the Schematron resource page (http://xml.ascc.net/schematron/)
To work with the example files for this tutorial, download x-schematron-files.zip. Note: You must register for the tutorial before you can download this zip file (https://www6.software.ibm.com/developerworks/education/x-schematron/x-schematron-files.zip).
Duration
Under one hour
Formats html, pdf
|  | |  |