I have the following:
<xs:complexType name="AnswerType">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="Checklist" type="ChecklistType" />
<xs:element name="OptionList" type="OptionListType" />
<xs:element name="Measurement" type="MeasureType" />
</xs:choice>
</xs:complexType>
How to I annotate the choice XSD element using SimpleXML? Currently I have to set them all to required=false
@Element(name = "Checklist", required=false)
protected ChecklistType checklist;
@Element(name = "OptionList", required=false)
protected OptionListType optionList;
@Element(name = "Measurement", required=false)
protected MeasureType measurement;
Surely there's a better way. One has to the required=true but how?