xsd: one of two childelements required, no repetition
I'm looking for a shema solution since a while. The idea is to have one parent element which stores 2 elements of different name. At least one of them must occur, but it is not defined which. It must not be possible to repeat one element twice (child1 should occurs maximum once).
My idea is something like this:
Generating a sample xml with XMLSpy shows, that this doesn't work.
<xs:element name="child1" minOccurs="0"/>
<xs:element name="child2" minOccurs="0"/>
Wrong in the example xml is:
- possible to repeat child1 (or child2) two times
- it is possible to declare a parent without child elements
Do you have an idea how to solve this problem?