My XSD
structure is like the below:-
>
You should read nillable and minOccurs XSD element attributes because the difference between nil
and an empty
element is significant in XML
. i.e. xsi:nil=true
is similar to SQL NULL
but having empty element represents the presents of an empty element. :)
I know it is confusing.
To fix your specific issue, if you are using JAXB
serialization to generate that, i recommend reading How to instantiate an empty element with JAXB. The question itself shows you how to generate an empty element.