Reverse DNS 1.1

default namespace = "http://www.apnic.net/specs/reversedns/1.1"

# A document may either be a single zone or a collection of zones
start = zone | zonelist

# A list of zone names
zonelist = element zonelist {
  attribute version {
    xsd:decimal { minInclusive="1.0" fractionDigits="1" }
  },
  zoneref*
}

# A zone reference
zoneref = element zoneref {
  attribute name { text },
  attribute href { xsd:anyURI }
}

# A single zone record
zone = element zone {
  # The zone record's name, eg 29.12.202.in-addr.arpa
  attribute name { text },
  # The canonical URL for this zone record
  attribute href { xsd:anyURI },
  # The address space for the zone record
  attribute ipversion { "ipv4" | "ipv6" },
  # The authority for the zone record
  attribute authority { text }?,
  # The last modified timestamp (optional)
  attribute modified  { xsd:dateTime }?,
  # Whether the zone should be published (default: true)
  attribute published { xsd:boolean }?,
  # The zone record revision number
  attribute revision { xsd:positiveInteger }?,
  # The schema version (only 1.0 is currently allowed)
  attribute version {
    xsd:decimal { minInclusive="1.0" fractionDigits="1" }
  },
  # A zone NS RRset must have at least one NS record
  nserver+,
  # It may contain some DS records
  ds*,
  # It must have both a technical and administrative contact
  contact,
  contact,
  # It may optionally also have some manager records
  manager*
}

# DNS-SEC records
ds = element ds {
  # rdata must contain  Flags | Protocol | Algorithm | Public Key
  # using SHA-1
  element rdata { text }
}


# A contact for the zone.  The nic-hdl attribute is the primary means
# of identifying the contact.  A server response must always include
# the nic-hdl attribute, but a client submission may omit it, as it
# will be computed from the child element.  In version 1.0 of this
# schema, only direct nic-hdl contacts are supported, but future
# versions may include other contact types, for which a nic-hdl will be
# generated or otherwise determined.
contact = element contact {
    attribute type { "technical" | "administrative" },
    attribute nic-hdl { text }?,
    nic-hdl-contact
}

# A contact specified by nic-hdl is simply a nic-hdl, nothing more
nic-hdl-contact = element nic-hdl { text }

# A single name server
nserver = element nserver {
  # The lame attribute indicates this server is lame (default: false)
  attribute lame { xsd:boolean }?,
  # An nserver entry must contain an FQDN name
  element fqdn { text }
}

# A manager record contains the name of the zone's manager, for
# informational purposes.
manager = element manager { text }