Re: optional, but at least one required

Hello Brian,

You can write the content model as:
(a, b?, c?) | (b, c?) | c

<xs:complexType>
   <xs:choice>
     <xs:sequence>
       <xs:element ref="a"/>
       <xs:element ref="b" minOccurs="0"/>
       <xs:element ref="c" minOccurs="0"/>
     </xs:sequence>
     <xs:sequence>
       <xs:element ref="b"/>
       <xs:element ref="c" minOccurs="0"/>
     </xs:sequence>
     <xs:element ref="c"/>
   </xs:choice>
</xs:complexType>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Brian Bonner wrote:
> Hello,
> 
> Is there a way through restrictions or xmlschema in general to create
> the following criteria?
> 
> <options>
>      <a></a>
>      <b></b>
>      <c></c>
> </options>
> 
> where the rule is that a, b and c are all optional, but at least one
> of a, b or c is required.
> 
> Thanks.
> 
> Brian
> 
> 

Received on Thursday, 5 January 2006 07:30:58 UTC