<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
    ns="http://jelix.org/ns/update/1.0"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    >

   <start>
      <element name="updates">
         <zeroOrMore>
            <element name="update">
            </element>
         </zeroOrMore>
      </element>
   </start>


   <define name="updateinfo">
      <attribute name="type">
         <choice>
            <value>major</value>
            <value>minor</value>
            <value>security</value>
         </choice>
      </attribute>
      <attribute name="version" />
      <zeroOrMore>
         <ref name="description" />
      </zeroOrMore>
      <oneOrMore>
         <element name="archive">
            <attribute name="type">
               <choice><value>partial</value><value>complete</value></choice>
            </attribute>
            <optional>
               <attribute name="size"><data type="integer"/></attribute>
            </optional>
            <oneOrMore>
               <element name="location">
                  <attribute name="URL">
                     <data type="anyURI" />
                  </attribute>
                  <attribute name="label" />
                  <empty />
               </element>
            </oneOrMore>
         </element>
      </oneOrMore>
   </define>

   <define name="description">
      <element name="description">
         <attribute name="lang">
            <data type="language" />
         </attribute>
         <optional>
            <attribute name="detailsURL">
               <data type="anyURI" />
            </attribute>
         </optional>
         <text />
      </element>
   </define>


</grammar>