>> English << | českyZVON > Tutorials > Schematron Tutorial

Contents

 Example 1 Each schema can specify several patterns.
 Example 2 Contents models can be open (it means that any other element can be also used) or closed (no other element can be used) .
 Example 3 Specification of required attribute
 Example 4 Test, if the root element has the specified name
 Example 5 Test, if an element is empty
 Example 6 Test, if an element has a predefined value
 Example 7 Test, if the value of an element is an integer
 Example 8 Test, if the source has the same number of both elements
 Example 9 The element must have the attribute, if it is inside another one, but it must not have the one otherwise
 Example 10 Character @ is forbidden in text.
 Example 11 If the element has one attribute then it must have the second one as well.
 Example 12 Value of the attribute is two or three character abbreviation.
 Example 13 The sum of values of all relevant elements equals 100.
 Example 14 The element must be a child of selected elements.
 Example 15 If an element contains an attribute , the attribute name must be id.
 Example 16 Examples of Patterns for ID/IDREF Checking
 Example 17 XML 1 (file source1.xml) contains a list of authors. These authors are referred to in XML 2. The Schematron checks if for each referred author in XML 2 exists an entry in XML 1.
 Example 18 A paragraph in XML 2 can only start with words specified in XML 1 (file source1.xml)