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

        <pre data-sub="prettyprint:_">

        <xs:element name="Root">
        <xs:complexType>
        <xs:sequence maxOccurs="2" minOccurs="1">
        <xs:element name="Id" type="xs:string" maxOccurs="4" minOccurs="2"/>
        <xs:element name="Name" type="xs:string" />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </pre>



        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.


        <pre data-sub="prettyprint:_">
        <mstns:Root>
        <mstns:Id>1</mstns:Id>
        <mstns:Id>2</mstns:Id>
        <mstns:Id>3</mstns:Id>
        <mstns:Name>dfsdf</mstns:Name>
        <mstns:Id>1</mstns:Id>
        <mstns:Id>2222</mstns:Id>
        <mstns:Name>fred</mstns:Name>
        </mstns:Root>
        </pre>


        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.

        <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_yUba7cqllFE/Ryi_9pmPa7I/AAAAAAAAACY/FcmRomR8pQ0/s1600-h/xsd1.PNG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_yUba7cqllFE/Ryi_9pmPa7I/AAAAAAAAACY/FcmRomR8pQ0/s400/xsd1.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5127559241620482994" /></a>


        <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_yUba7cqllFE/RyjAOZmPa8I/AAAAAAAAACg/DBF_-4pF4YY/s1600-h/xsd2.PNG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_yUba7cqllFE/RyjAOZmPa8I/AAAAAAAAACg/DBF_-4pF4YY/s400/xsd2.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5127559529383291842" /></a>