default namespace = "http://novell.com/package/metadata/suse/updateinfo"

include "common-inc.rnc"

start = element updates {
  element update {
    # Seen missing in the wild
    attribute from { "maint-coord@suse.de" }?,
    attribute status { "stable" },
    attribute type { "recommended" | "security" | "optional" | "feature" },
    attribute version { xsd:string },
    element id { text },
    element title { text },
    # Seen missing in the wild
    element release { text }?,
    # Usually with date attribute, but seen in the wild with content instead
    element issued {
      (attribute date { private.unixts } | private.unixts)
    },
    # Seen missing in the wild
    element references {
      element 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 href { xsd:anyURI },
        attribute id { xsd:string },
        attribute title { xsd:string },
        attribute type { "bugzilla" | "cve" }
      }+
    }?,
    element description { text },
    element pkglist {
      element collection {
        element package {
	  attribute name { xsd:string },
          attribute arch { private.archenum },
          # not private.evr because "version" and "release" are spelled out
          attribute epoch { private.nonnegative }?,
          attribute version { text }?,
          attribute release { text }?,
          element filename { text },
	  element restart_suggested { "1" }?,
	  element reboot_suggested { "1" }?,
	  element relogin_suggested { "1" }?
        }+
      }
    }
  }+
}

