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

  <start>
    <ref name="aggregate-element"/>
  </start>

  <define ns="" name="aggregate-element">
    <element name="aggregatelist">
      <optional>
        <attribute name="resign">
          <choice>
            <value>true</value> <!-- default -->
            <value>false</value>
          </choice>
        </attribute>
      </optional>
      <zeroOrMore>
        <element ns="" name="aggregate">
          <optional>
            <attribute name="project">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="arch">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="sourcearch"> <!-- is only working for local atm -->
              <text/>
            </attribute>
          </optional>
          <interleave> 
            <zeroOrMore>
              <element ns="" name="binary">
                <text/>
              </element>
            </zeroOrMore>
            <zeroOrMore>
              <element ns="" name="binaryarch">
                <text/>
              </element>
            </zeroOrMore>
            <optional>
              <element ns="" name="nosources">
                <text/>
              </element>
            </optional>
            <optional>
              <element ns="" name="noupdateinfo">
                <text/>
              </element>
            </optional>
            <zeroOrMore>
              <element ns="" name="package">
                <text/>
              </element>
            </zeroOrMore>
            <zeroOrMore>
              <element ns="" name="repository">
                <optional>
                  <attribute name="source">
                    <text/>
                  </attribute>
                </optional>
                <optional>
                  <attribute name="target">
                    <text/>
                  </attribute>
                </optional>
                <empty/>
              </element>
            </zeroOrMore>
          </interleave> 
        </element>
      </zeroOrMore>
    </element>
  </define>
</grammar>
