-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
  • 5,651
  • 3
  • 41
  • 64

2 Answers2

1

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
  • 658
  • 5
  • 11
1

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

theBittor
  • 652
  • 1
  • 9
  • 19