<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="http://novell.com/package/metadata/suse/updateinfo" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <include href="common-inc.rng"/>
  <start>
    <element name="updates">
      <oneOrMore>
        <element name="update">
          <optional>
            <!-- Seen missing in the wild -->
            <attribute name="from">
              <value>maint-coord@suse.de</value>
            </attribute>
          </optional>
          <attribute name="status">
            <value>stable</value>
          </attribute>
          <attribute name="type">
            <choice>
              <value>recommended</value>
              <value>security</value>
              <value>optional</value>
              <value>feature</value>
            </choice>
          </attribute>
          <attribute name="version">
            <data type="string"/>
          </attribute>
          <element name="id">
            <text/>
          </element>
          <element name="title">
            <text/>
          </element>
          <optional>
            <!-- Seen missing in the wild -->
            <element name="release">
              <text/>
            </element>
          </optional>
          <!-- Usually with date attribute, but seen in the wild with content instead -->
          <element name="issued">
            <choice>
              <attribute name="date">
                <ref name="private.unixts"/>
              </attribute>
              <ref name="private.unixts"/>
            </choice>
          </element>
          <optional>
            <!-- Seen missing in the wild -->
            <element name="references">
              <oneOrMore>
                <element name="reference">
                  <!--
                    Appears to always start with https://bugzilla.novellc.om/show_bug.cgi?id=
                     if type="bugzilla" and http://cve.mitre.org/cgi-bin/cvename.cgi?name=
                     if type="cve"
                  -->
                  <attribute name="href">
                    <data type="anyURI"/>
                  </attribute>
                  <attribute name="id">
                    <data type="string"/>
                  </attribute>
                  <attribute name="title">
                    <data type="string"/>
                  </attribute>
                  <attribute name="type">
                    <choice>
                      <value>bugzilla</value>
                      <value>cve</value>
                    </choice>
                  </attribute>
                </element>
              </oneOrMore>
            </element>
          </optional>
          <element name="description">
            <text/>
          </element>
          <element name="pkglist">
            <element name="collection">
              <oneOrMore>
                <element name="package">
                  <attribute name="name">
                    <data type="string"/>
                  </attribute>
                  <attribute name="arch">
                    <ref name="private.archenum"/>
                  </attribute>
                  <optional>
                    <!-- not private.evr because "version" and "release" are spelled out -->
                    <attribute name="epoch">
                      <ref name="private.nonnegative"/>
                    </attribute>
                  </optional>
                  <optional>
                    <attribute name="version"/>
                  </optional>
                  <optional>
                    <attribute name="release"/>
                  </optional>
                  <element name="filename">
                    <text/>
                  </element>
                  <optional>
                    <element name="restart_suggested">
                      <value>1</value>
                    </element>
                  </optional>
                  <optional>
                    <element name="reboot_suggested">
                      <value>1</value>
                    </element>
                  </optional>
                  <optional>
                    <element name="relogin_suggested">
                      <value>1</value>
                    </element>
                  </optional>
                </element>
              </oneOrMore>
            </element>
          </element>
        </element>
      </oneOrMore>
    </element>
  </start>
</grammar>
