-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,270
  • 4
  • 44
  • 68

2 Answers2

2

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
  • 668
  • 5
  • 14
1

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

theBittor
  • 724
  • 1
  • 11
  • 20