
Got it: --------- | <!-- Do not allow <remarks> unless <desc> is present: --> | <!-- ( gloss*, ( desc+, ( gloss, desc* )*, remarks* )?, paramList? ) --> | <!-- | Note that the optional clause $2 that contains the only reference | to <remarks> has a required <desc>. | --> | <content> | <sequence> | <classRef key="model.glossLike" minOccurs="0" maxOccurs="unbounded"/> | <sequence minOccurs="0"> | <classRef key="model.descLike" minOccurs="1" maxOccurs="unbounded"/> | <sequence minOccurs="0" maxOccurs="unbounded"> | <classRef key="model.glossLike" minOccurs="1" maxOccurs="1"/> | <classRef key="model.descLike" minOccurs="0" maxOccurs="unbounded"/> | </sequence> | <elementRef key="remarks" minOccurs="0" maxOccurs="unbounded"/> | </sequence> | <elementRef key="paramList" minOccurs="0" maxOccurs="1"/> | </sequence> | </content> --------- It works when I build locally (although lots of other things go wrong). Try it, Martina, and see what Mr. Jenkins thinks.
I think the following would do the trick for RELAX NG, but will be ambiguous in DTD-land. Will be working on re-factoring it unambiguously soon, but if anyone else wants to take a stab, please feel free. --------- | <content> | <sequence> | <alternate minOccurs="0" maxOccurs="1"> | <sequence> | <!-- with <desc> and optional <remarks> --> | <classRef key="model.glossLike" minOccurs="0" maxOccurs="unbounded"/> | <classRef key="model.descLike" minOccurs="1" maxOccurs="unbounded"/> | <sequence minOccurs="0" maxOccurs="unbounded"> | <classRef key="model.glossLike" minOccurs="1" maxOccurs="unbounded"/> | <classRef key="model.descLike" minOccurs="0" maxOccurs="unbounded"/> | </sequence> | <elementRef key="remarks" minOccurs="0" maxOccurs="unbounded"/> | </sequence> | <sequence> | <!-- with optional <desc>, no <remarks> --> | <alternate minOccurs="0" maxOccurs="unbounded"> | <classRef key="model.descLike"/> | <classRef key="model.glossLike"/> | </alternate> | </sequence> | </alternate> | <elementRef key="paramList" minOccurs="0" maxOccurs="1"/> | </sequence> | </content> ---------
If we can't get this working, would could of course resort to:
--------- | <constraintSpec ident="no-remarks-without-desc" scheme="schematron"> | <constraint> | <sch:rule context="tei:valItem[tei:remarks]"> | <sch:assert test="tei:desc">A value item should only have a remarks section if it also has a description</sch:assert> | </sch:rule> | </constraint> | </constraintSpec> --------- :-)