Search code examples
xmlxsd

How to make element in a Xml schema as optional?


I have one element that I need to make optional.

<xs:element name="Version" type="xs:string" minOccurs="1" />

Is there any other way than making minOccurs="0"?


Solution

  • No, that is the proper way to do it. Is there some reason why you wish to avoid minOccurs="0"?