I have an XML file like this
<listOfA>
<a type="1">
<name></name>
<surname></surname>
</a>
<a type="2">
<name></name>
<id></id>
</a>
</listOfA>
I would like to make XSD, so if the value of the "type" attribute is 1, then the elements of the name and surname should be present, and with its 2 - the name and identifier. I tried to generate XSD in the XSD schema generator , but it made the last name and id element minOccurs = 0. How can I make it work?
source
share