xml - XSD Schema - Sequence and List for checkboxes -


i got small confusion xsd schema. need cover checkboxes (i.e. multiple values per element). see below:

[1]

<xsd:element name="parent">  <xsd:complextype>   <xsd:sequence>    <xsd:element maxoccurs="2" minoccurs="0" name="children">     <xsd:complextype>      <xsd:sequence>       <xsd:element name="child" type="xsd:string">       .       . 

this means can have:

<parent>  <children>   <child />  </children>   <children>   <child />  </children>  </parent> 

now can same defined , achieved <xsd:list>? this:

<xsd:element name="parent">  <xsd:complextype>   <xsd:sequence>    <xsd:element name="children">          <xsd:simpletype>      <xsd:list>       <xsd:simpletype>        <xsd:restriction base="xsd:string">             <xsd:enumeration value="child 1"/>         <xsd:enumeration value="child 2"/>            </xsd:restriction>       </xsd:simpletype>      </xsd:list>     </xsd:simpletype>     </xsd:element> 

so, overall bit confused between xsd:list , minoccurs/maxoccurs.

the xsd:list element defines possible values, not possible child elements - second example defines element children has valid content space-separated list of strings child 1 , child 2 - i.e. xml this:

<parent>    <children>child 1</children>  </parent> 

or

<parent>    <children>child 2</children>  </parent> 

or

<parent>    <children>child 1 child 2</children>  </parent> 

note values in list defined xsd:list space-separated, should not contain spaces.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -