-1

Is the default value for minOccurs and maxOccurs attributes ever not 1 for an xml schema?

I am wondering if it is safe to simply remove all minOccurs="1" and maxOccurs="1" because they are (possibly, depending on the answer) just clogging the schema up with superfluous text.

Captain Man
  • 6,997
  • 6
  • 48
  • 74

2 Answers2

3

minOccurs and maxOccurs have a default value of 1, and thus it is safe to remove them.

You may want to watch out if your schema contains extensions of a complexType though. As they might change the values, which are inherited.

cvesters
  • 678
  • 5
  • 14
2

Yes. The default value for both the minOccurs and the maxOccurs attributes is 1. See this section of the specification

theBittor
  • 786
  • 1
  • 11
  • 20