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'd like to make an XSD, so that if the value of the attribute "type" is 1, the name and surname elements must be present, and when it's 2, name and id must be there. I tried to generate the XSD in XSD schema generator, but it made the surname and id element minOccurs=0. How could I make it work?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…