Thursday 8 January 2009

Default values of minOccurs and maxOccurs

The default values of minOccurs and maxOccurs is 1. Meaning that the following XML schema element allows zero or one element:

<xs:element name="realmCode" type="CS" minoccurs="0"></xs:element>

while:

<xs:element name="realmCode" type="CS">
</xs:element>

allows one and only one.

W3 specification