Alex
Alex

Reputation: 40425

How to tell if XML element is marked as required in the XSD file

I need to mark some elements as non required in the XSD schema. How do I go about figuring out which elements are marked as required, is there any particular flag I should be searching for. Currently all of my elements are marked with minOccurs="0", is this what needs to be changed?

Upvotes: 21

Views: 26283

Answers (1)

Trey
Trey

Reputation: 11158

Yes.

minOccurs="0" is what you need to add to an element as optional.
Having no minOccurs attribute implies mandatory (since by default minOccurs="1")

Upvotes: 38

Related Questions