I tried a couple of things:
1)
<xs:simpleType name="matchAnalysisType">
<xs:restriction base="xs:string">
<xs:enumeration value="A"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
JaxB DOESN'T generate enums and instead marks matchAnalysisType as string for the corresponding element type.
2) Use 'nillable':
<xs:element name="matchAnalysisType" type="matchAnalysisType"
nillable="true">
</xs:element>
JaxB throws error that '' is not valid.
The issue holds true for other element types like the following:
<xs:element name="accountNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="9"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
I'd like to have a sample xml that allows this the following without any validation errors.
<accountNumber></accountNumber>
Thoughts?