namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

form =
  element form {
    attlist.form,
    (label
     | field
     | image
     | separator
     | newline
     | button
     | notebook
     | group
     | hpaned
     | vpaned)*
  }
attlist.form &=
  [ a:defaultValue = "Unknown" ] attribute string { text }?
attlist.form &= attribute on_write { text }?
attlist.form &= [ a:defaultValue = "4" ] attribute col { text }?
attlist.form &= attribute cursor { text }?

label = element label { attlist.label, empty }
attlist.label &= [ a:defaultValue = "" ] attribute string { text }?
attlist.label &= ( attribute name { text } | attribute id { text } )
attlist.label &= attribute states { text }?
attlist.label &= [ a:defaultValue = "0.0" ] attribute xalign { text }?
attlist.label &= [ a:defaultValue = "0.5" ] attribute yalign { text }?
attlist.label &=
  [ a:defaultValue = "0" ] attribute yexpand { "0" | "1" }?
attlist.label &= [ a:defaultValue = "0" ] attribute yfill { "0" | "1" }?
attlist.label &=
  [ a:defaultValue = "0" ] attribute xexpand { "0" | "1" }?
attlist.label &= [ a:defaultValue = "1" ] attribute xfill { "0" | "1" }?
attlist.label &= [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.label &= attribute help { text }?

field = element field { attlist.field, empty }
attlist.field &= attribute name { text }
attlist.field &= [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.field &=
  attribute widget {
    "date"
    | "char"
    | "many2one"
    | "date"
    | "one2many"
    | "selection"
    | "float"
    | "numeric"
    | "float_time"
    | "integer"
    | "datetime"
    | "boolean"
    | "text"
    | "url"
    | "email"
    | "callto"
    | "sip"
    | "sha"
    | "reference"
    | "binary"
    | "many2many"
    | "image"
    | "progressbar"
    | "richtext"
  }?
attlist.field &= attribute fill { "0" | "1" }?
attlist.field &= attribute yexpand { "0" | "1" }?
attlist.field &= attribute yfill { "0" | "1" }?
attlist.field &= attribute empty { "0" | "1" }?
attlist.field &=
  [ a:defaultValue = "1" ] attribute xexpand { "0" | "1" }?
attlist.field &= [ a:defaultValue = "1" ] attribute xfill { "0" | "1" }?
attlist.field &= [ a:defaultValue = "0.0" ] attribute xalign { text }?
attlist.field &= [ a:defaultValue = "0.5" ] attribute yalign { text }?
attlist.field &= attribute help { text }?
attlist.field &= attribute width { text }?
attlist.field &= attribute height { text }?
attlist.field &= attribute readonly { "0" | "1" }?
attlist.field &=
  [ a:defaultValue = "0" ] attribute tree_invisible { "0" | "1" }?
attlist.field &= attribute mode { text }?
attlist.field &= attribute view_ids { text }?
attlist.field &=
  [ a:defaultValue = "0" ] attribute invisible { "0" | "1" }?
attlist.field &= attribute sum { text }?
attlist.field &= attribute key { text }?
attlist.field &= attribute domain { text }?
attlist.field &= attribute color { text }?
attlist.field &=
  [ a:defaultValue = "left_to_right" ] attribute orientation {
    "left_to_right"
    | "right_to_left"
    | "bottom_to_top"
    | "top_to_bottom"
  }?
attlist.field &= attribute spell { text }?
attlist.field &= attribute float_time { text }?
attlist.field &= attribute img_width { text }?
attlist.field &= attribute img_height { text }?
attlist.field &=
  [a:defaultValue = "0"] attribute filename_visible { "0" | "1" }?
image = element image { attlist.image, empty }
attlist.image &= attribute name { text }
attlist.image &= [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.image &=
  [ a:defaultValue = "0" ] attribute yexpand { "0" | "1" }?
attlist.image &= [ a:defaultValue = "0" ] attribute yfill { "0" | "1" }?
attlist.image &=
  [ a:defaultValue = "0" ] attribute xexpand { "0" | "1" }?
attlist.image &= [ a:defaultValue = "0" ] attribute xfill { "0" | "1" }?
attlist.image &= attribute help { text }?
attlist.image &= attribute states { text }?
separator = element separator { attlist.separator, empty }
attlist.separator &= [ a:defaultValue = "" ] attribute string { text }?
attlist.separator &= ( attribute name { text } | attribute id { text} )
attlist.separator &= attribute states { text }?
attlist.separator &=
  [ a:defaultValue = "0.0" ] attribute xalign { text }?
attlist.separator &=
  [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.separator &=
  [ a:defaultValue = "0" ] attribute yexpand { "0" | "1" }?
attlist.separator &=
  [ a:defaultValue = "0" ] attribute yfill { "0" | "1" }?
attlist.separator &=
  [ a:defaultValue = "0" ] attribute xexpand { "0" | "1" }?
attlist.separator &=
  [ a:defaultValue = "0" ] attribute xfill { "0" | "1" }?
attlist.separator &= attribute help { text }?
newline = element newline { attlist.newline, empty }
attlist.newline &= empty
button = element button { attlist.button, empty }
attlist.button &= [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.button &= attribute help { text }?
attlist.button &=
  [ a:defaultValue = "Unknown" ] attribute string { text }?
attlist.button &= attribute icon { text }?
attlist.button &=
  [ a:defaultValue = "object" ]
  attribute type { "object" | "action" }?
attlist.button &= attribute confirm { text }?
attlist.button &= attribute name { text }
attlist.button &= attribute states { text }?
notebook = element notebook { attlist.notebook, page* }
attlist.notebook &= [ a:defaultValue = "4" ] attribute colspan { text }?
page =
  element page {
    attlist.page,
    (label
     | field
     | image
     | separator
     | newline
     | button
     | notebook
     | group
     | hpaned
     | vpaned)*
  }
attlist.page &= attribute angle { text }?
attlist.page &= attribute icon { text }?
attlist.page &=
  [ a:defaultValue = "Unknown" ] attribute string { text }?
attlist.page &= [ a:defaultValue = "4" ] attribute col { text }?
attlist.page &= ( attribute name { text } | attribute id { text } )
attlist.page &= attribute states { text }?
group =
  element group {
    attlist.group,
    (label
     | field
     | image
     | separator
     | newline
     | button
     | notebook
     | group
     | hpaned
     | vpaned)*
  }
attlist.group &= attribute string { text }?
attlist.group &= [ a:defaultValue = "1" ] attribute colspan { text }?
attlist.group &=
  [ a:defaultValue = "0" ] attribute yexpand { "0" | "1" }?
attlist.group &= [ a:defaultValue = "1" ] attribute yfill { "0" | "1" }?
attlist.group &=
  [ a:defaultValue = "0" ] attribute xexpand { "0" | "1" }?
attlist.group &= [ a:defaultValue = "1" ] attribute xfill { "0" | "1" }?
attlist.group &= [ a:defaultValue = "1" ] attribute rowspan { text }?
attlist.group &= [ a:defaultValue = "4" ] attribute col { text }?
attlist.group &= ( attribute name { text } | attribute id { text } )
attlist.group &= attribute states { text }?

hpaned = element hpaned { attlist.paned, child* }

vpaned = element vpaned { attlist.paned, child* }

attlist.paned &= [ a:defaultValue = "4" ] attribute colspan { text }?
attlist.paned &= attribute position { text }?
attlist.paned &= attribute id { text }

child =
  element child {
    attlist.child,
    (label
     | field
     | image
     | separator
     | newline
     | button
     | notebook
     | group
     | hpaned
     | vpaned)*
  }

attlist.child &= attribute id { text }

data = element data { attlist.data, xpath* }
attlist.data &= empty

xpath = element xpath { attlist.xpath,
    (label
    | field
    | image
    | separator
    | newline
    | button
    | notebook
    | group
    | hpaned
    | vpaned
    | form
    | page
    | child)*
  }
attlist.xpath &= attribute expr { text }
attlist.xpath &=
  [ a:defaultValue = "inside" ]
  attribute position { "inside" | "replace" | "replace_attributes" | "after" | "before" }?

start = data | form
