Hi Rob, > I have a list of 5 elements. I want to have at least 2 of them > appearing. With none of them appearing twice. > > Is there a cleann way of defining this other than defining a choice > between each possible combination!! Aside from defining a choice between each possible combination, your best bet is to create a more generous model: <xs:choice minOccurs="2"> <xs:element name="E1" /> <xs:element name="E2" /> <xs:element name="E3" /> <xs:element name="E4" /> <xs:element name="E5" /> </xs:choice> and then use Schematron to report whether there's more than one of the same element: <sch:rule context="*"> <sch:report test="preceding-sibling::*[name() = name(current())]"> There's more than one <sch:name /> element. </sch:report> </sch:rule> See http://www.topologi.com/public/Schtrn_XSD/Paper.html for details about how to incorporate Schematron rules into XML Schema schemas. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/Received on Tuesday, 9 April 2002 13:09:13 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT