Schematron example
Sets up the name element as the context
<pattern name="Validate name against RNC
{ given* & family & title? }">
<rule context="name">
<assert test="family">'family' element is missing</assert>
<report test="*[not(self::given | self:: family |
self::title)]">Element not allowed</report>
<report test="text()[normalize-space()]">Text content not
allowed</report>
<report test="count(family) > 1">More than one 'family'
element is not allowed</report>
<report test="count(title) > 1">More than one 'title'
element is not allowed</report>
</rule>
</pattern>
|
(RNC is the RELAX NG compact syntax)