<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:simpleType name="stringtype">
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="preserve" />
      <xs:minLength value="1" />
      <xs:pattern value="[^\s].+[^\s]|[^\s]"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="filetype">
    <xs:sequence>
      <xs:element name="hash" type="hashtype" maxOccurs="unbounded" minOccurs="1"/>
    </xs:sequence>
    <xs:attribute type="stringtype" name="src" use="required"/>
  </xs:complexType>

  <xs:simpleType name="md5type">
    <xs:restriction base="stringtype">
      <xs:pattern value="[0-9a-f]{32}"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="hashtype">
    <xs:sequence minOccurs="1" maxOccurs="1">
      <xs:element name="version" type="stringtype"/>
    </xs:sequence>
    <xs:attribute type="md5type" name="md5" use="required"/>
  </xs:complexType>

  <xs:element name="wp-versions">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="file" type="filetype" maxOccurs="unbounded" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
