I want to create a complex element that will have the following type of structure:
<parent>
<child1/>
<child2/>
</parent>
The requiremenets are:
EITHER child1 OR child2 must exist, or
BOTH child1 AND child2 must exist
However, it is NOT acceptable if NEITHER child elements exist. (I would also like to allow 0 to unbounded number of child1 elements.)
An example of this is a traditional C-type "switch" statement, where a user can have 0 to N "case" statements, and/or 0 or 1 "default" statements, but cannot be missing both.
Is there any way, using XML Schema language, to ensure that an XML document conforms to these requirements?
<parent>
<child1/>
<child2/>
</parent>
The requiremenets are:
EITHER child1 OR child2 must exist, or
BOTH child1 AND child2 must exist
However, it is NOT acceptable if NEITHER child elements exist. (I would also like to allow 0 to unbounded number of child1 elements.)
An example of this is a traditional C-type "switch" statement, where a user can have 0 to N "case" statements, and/or 0 or 1 "default" statements, but cannot be missing both.
Is there any way, using XML Schema language, to ensure that an XML document conforms to these requirements?