Repeated and empty elements
Monday, March 29, 2010
1:59 PM
Repeated and empty elements
contents of [file]...
<?xml version='1.0'?>
<xs:schema xmlns:xs="[link]"> 
  
  <xs:element name="phonelist" type="myListType"/>
  <xs:complexType name="myListType">
    <xs:sequence>
      <xs:element name="phone" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="number" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema> 
...end of [file]
Pasted from <[link]> 
MinOccurs='0': can be empty
MaxOccurs='unbounded': no length limit. 
Matches, e.g., 
<phonelist>
  <phone number='555-1212'/>
  <phone number='1-800-food'/>
</phonelist>