Oct 31, 2007

xsd maxOccurs="2" minOccurs="1"

XSD allow you to specified maxOccurs="2" minOccurs="1" in sequence and and element. What is the difference. Below is section

            
            
            
            
            
            
            
            
            
sequence with maxOccurs more than 1 means you can repeat the whole section more than one time, element with maxOccurs more than 1 means you can repeat that element for more than one time. There is no difference if the sequence has only one element. You can put maxOccurs on the sequence or the element. If there are more than one element in sequence there will be difference.
            
            1
            2
            3
            dfsdf
            1
            2222
            fred
            
            
Generally, we should put maxOccur on element rather on sequence. Or you can convert a sequence into a complex type and make that a element of that type, and put maxOccur on that element.