Martin Holmes wrote:
>
> Where seg/@type = 'type_01', then seg/@subtype must be one of 'a', 'b'
> or 'c';
>
> Where seg/@type = 'type_02', then seg/@subtype must be one of 'x',
> 'y', or 'z'.
>
> Is this possible, and if so, how would I encode this into an ODD file?
>
You cannot model dependencies between attributes in RELAXNG, so you'd have
to write Schematron rules (allowed inside <content>). Off the top of my
head:
<s:pattern name="segTypes">
<s:rule context="tei:seg">
<s:assert
test="@type='TYPE_01'
and not(@subtype='a' or 'b' or 'c')">
Type TYPE_01 is associated with subtypes a, b, or c only
</s:assert>
<s:assert
test="@type='TYPE_02'
and not(@subtype='x' or 'y' or 'z')">
Type TYPE_01 is associated with subtypes x, y, or z only
</s:assert>
</s:rule>
</s:pattern>
but you may be able to express more elegantly.
--
Sebastian Rahtz
Information Manager, Oxford University Computing Services
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431
|