<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
  <define name="form">
    <element name="form">
      <ref name="attlist.form"/>
      <zeroOrMore>
        <choice>
          <ref name="label"/>
          <ref name="field"/>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="newline"/>
          <ref name="button"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.form" combine="interleave">
    <optional>
      <attribute name="string" a:defaultValue="Unknown"/>
    </optional>
  </define>
  <define name="attlist.form" combine="interleave">
    <optional>
      <attribute name="on_write"/>
    </optional>
  </define>
  <define name="attlist.form" combine="interleave">
    <optional>
      <attribute name="col" a:defaultValue="4"/>
    </optional>
  </define>
  <define name="attlist.form" combine="interleave">
    <optional>
      <attribute name="cursor"/>
    </optional>
  </define>
  <define name="label">
    <element name="label">
      <ref name="attlist.label"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="string" a:defaultValue=""/>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <choice>
      <attribute name="name"/>
      <attribute name="id"/>
    </choice>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="xalign" a:defaultValue="0.0"/>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="yalign" a:defaultValue="0.5"/>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="yexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="yfill" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="xexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="xfill" a:defaultValue="1">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute name="help"/>
    </optional>
  </define>
  <define name="field">
    <element name="field">
      <ref name="attlist.field"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.field" combine="interleave">
    <attribute name="name"/>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="widget">
        <choice>
          <value>date</value>
          <value>char</value>
          <value>many2one</value>
          <value>date</value>
          <value>one2many</value>
          <value>selection</value>
          <value>float</value>
          <value>numeric</value>
          <value>float_time</value>
          <value>integer</value>
          <value>datetime</value>
          <value>boolean</value>
          <value>text</value>
          <value>url</value>
          <value>email</value>
          <value>callto</value>
          <value>sip</value>
          <value>sha</value>
          <value>reference</value>
          <value>binary</value>
          <value>many2many</value>
          <value>image</value>
          <value>progressbar</value>
          <value>richtext</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="fill">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="yexpand">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="yfill">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="empty">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="xexpand" a:defaultValue="1">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="xfill" a:defaultValue="1">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="xalign" a:defaultValue="0.0"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="yalign" a:defaultValue="0.5"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="help"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="width"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="height"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="readonly">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="tree_invisible" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="mode"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="view_ids"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="invisible" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="sum"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="key"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="domain"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="color"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="orientation" a:defaultValue="left_to_right">
        <choice>
          <value>left_to_right</value>
          <value>right_to_left</value>
          <value>bottom_to_top</value>
          <value>top_to_bottom</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="spell"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="float_time"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="img_width"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="img_height"/>
    </optional>
  </define>
  <define name="attlist.field" combine="interleave">
    <optional>
      <attribute name="filename_visible" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="image">
    <element name="image">
      <ref name="attlist.image"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.image" combine="interleave">
    <attribute name="name"/>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="yexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="yfill" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="xexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="xfill" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="help"/>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="separator">
    <element name="separator">
      <ref name="attlist.separator"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="string" a:defaultValue=""/>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <choice>
      <attribute name="name"/>
      <attribute name="id"/>
    </choice>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="xalign" a:defaultValue="0.0"/>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="yexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="yfill" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="xexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="xfill" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute name="help"/>
    </optional>
  </define>
  <define name="newline">
    <element name="newline">
      <ref name="attlist.newline"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.newline" combine="interleave">
    <empty/>
  </define>
  <define name="button">
    <element name="button">
      <ref name="attlist.button"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="help"/>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="string" a:defaultValue="Unknown"/>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="icon"/>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="type" a:defaultValue="object">
        <choice>
          <value>object</value>
          <value>action</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="confirm"/>
    </optional>
  </define>
  <define name="attlist.button" combine="interleave">
    <attribute name="name"/>
  </define>
  <define name="attlist.button" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="notebook">
    <element name="notebook">
      <ref name="attlist.notebook"/>
      <zeroOrMore>
        <ref name="page"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.notebook" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="4"/>
    </optional>
  </define>
  <define name="page">
    <element name="page">
      <ref name="attlist.page"/>
      <zeroOrMore>
        <choice>
          <ref name="label"/>
          <ref name="field"/>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="newline"/>
          <ref name="button"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute name="angle"/>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute name="icon"/>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute name="string" a:defaultValue="Unknown"/>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute name="col" a:defaultValue="4"/>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <choice>
      <attribute name="name"/>
      <attribute name="id"/>
    </choice>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="group">
    <element name="group">
      <ref name="attlist.group"/>
      <zeroOrMore>
        <choice>
          <ref name="label"/>
          <ref name="field"/>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="newline"/>
          <ref name="button"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="string"/>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="yexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="yfill" a:defaultValue="1">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="xexpand" a:defaultValue="0">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="xfill" a:defaultValue="1">
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="rowspan" a:defaultValue="1"/>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="col" a:defaultValue="4"/>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <choice>
      <attribute name="name"/>
      <attribute name="id"/>
    </choice>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute name="states"/>
    </optional>
  </define>
  <define name="hpaned">
    <element name="hpaned">
      <ref name="attlist.paned"/>
      <zeroOrMore>
        <ref name="child"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="vpaned">
    <element name="vpaned">
      <ref name="attlist.paned"/>
      <zeroOrMore>
        <ref name="child"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.paned" combine="interleave">
    <optional>
      <attribute name="colspan" a:defaultValue="4"/>
    </optional>
  </define>
  <define name="attlist.paned" combine="interleave">
    <optional>
      <attribute name="position"/>
    </optional>
  </define>
  <define name="attlist.paned" combine="interleave">
    <attribute name="id"/>
  </define>
  <define name="child">
    <element name="child">
      <ref name="attlist.child"/>
      <zeroOrMore>
        <choice>
          <ref name="label"/>
          <ref name="field"/>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="newline"/>
          <ref name="button"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.child" combine="interleave">
    <attribute name="id"/>
  </define>
  <define name="data">
    <element name="data">
      <ref name="attlist.data"/>
      <zeroOrMore>
        <ref name="xpath"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.data" combine="interleave">
    <empty/>
  </define>
  <define name="xpath">
    <element name="xpath">
      <ref name="attlist.xpath"/>
      <zeroOrMore>
        <choice>
          <ref name="label"/>
          <ref name="field"/>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="newline"/>
          <ref name="button"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="form"/>
          <ref name="page"/>
          <ref name="child"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.xpath" combine="interleave">
    <attribute name="expr"/>
  </define>
  <define name="attlist.xpath" combine="interleave">
    <optional>
      <attribute name="position" a:defaultValue="inside">
        <choice>
          <value>inside</value>
          <value>replace</value>
          <value>replace_attributes</value>
          <value>after</value>
          <value>before</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <start>
    <choice>
      <ref name="data"/>
      <ref name="form"/>
    </choice>
  </start>
</grammar>
