<xs:simpleType name="availability" final="restriction" >
    <xs:restriction base="xs:string">
        <xs:enumeration value="instock" />
        <xs:enumeration value="outofstock" />
    </xs:restriction>
</xs:simpleType>
<xs:simpleType name="nonEmptyInteger">
  <xs:restriction base="xs:integer">
    <xs:minLength value="1"/>
  </xs:restriction>
</xs:simpleType>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="products">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="product" maxOccurs="unbounded" minOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="external-prod-id"/>
              <xs:element type="xs:string" name="name"/>
              <xs:element type="xs:string" name="description"/>
              <xs:element type="xs:string" name="category" maxOccurs="unbounded" minOccurs="0"/>
              <xs:element type="xs:string" name="tag" maxOccurs="unbounded" minOccurs="0"/>
              <xs:element type="xs:string" name="brand"/>
              <xs:element type="nonEmptyInteger" name="priority"/>
              <xs:element type="xs:anyURI" name="detail-url"/>
              <xs:element type="xs:anyURI" name="image-url"/>
              <xs:element type="xs:anyURI" name="image-url-thumb"/>
              <xs:element type="xs:decimal" name="unit-price"/>
              <xs:element type="xs:decimal" name="original-unit-price"/>
              <xs:element type="xs:decimal" name="unit-price-without-vat"/>
              <xs:element type="xs:decimal" name="discount-amount"/>
              <xs:element type="xs:decimal" name="discount-percent"/>
              <xs:element type="xs:string" name="related-product-id" maxOccurs="unbounded" minOccurs="0"/>
              <xs:element type="nonEmptyInteger" name="reviews"/>
              <xs:element type="nonEmptyInteger" name="rating"/>
              <xs:element type="availability" name="availaibility"/>
              <xs:element type="nonEmptyInteger" name="stock"/>
              <xs:element type="xs:boolean" name="black-list"/>
              <xs:element type="xs:dateTime" name="publish-date"/>
              <xs:element type="xs:string" name="custom-field-1"/>
              <xs:element type="xs:string" name="custom-field-2"/>
              <xs:element type="xs:string" name="custom-field-3"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
