[tei-council] more on constraints
Sebastian Rahtz
sebastian.rahtz at oucs.ox.ac.uk
Thu Mar 26 01:59:04 EDT 2009
I just added, fwiw, a real example from the Guidelines:
<p>Constraints are generally used to model local rules which are outside
the scope of
conventional schema languages. For example, the TEI element
<gi>relation</gi>
has a note that
<q>Only one of the attributes <att>active</att> and
<att>mutual</att> may be supplied; the attribute <att>passive</att>
may be supplied only if the attribute <att>active</att> is
supplied.</q>, which can be written in Schematron as
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<constraint>
<s:report test="@active and @mutual">Only one of the attributes
'active' and 'mutual' may be supplied</s:report>
<s:report test="@passive and not(@active)">the attribute 'passive'
may be supplied only if the attribute 'active' is
supplied</s:report>
</constraint>
</egXML>
</p>
--
Sebastian Rahtz
Information Manager, Oxford University Computing Services
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431
Sólo le pido a Dios
que el futuro no me sea indiferente
More information about the tei-council
mailing list