<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
  <define name="board">
    <element>
      <name ns="">board</name>
      <ref name="attlist.board"/>
      <zeroOrMore>
        <choice>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="label"/>
          <ref name="newline"/>
          <ref name="link"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="action"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.board" combine="interleave">
    <optional>
      <attribute a:defaultValue="4">
        <name ns="">col</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="image">
    <element>
      <name ns="">image</name>
      <ref name="attlist.image"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.image" combine="interleave">
    <attribute>
      <name ns="">name</name>
      <text/>
    </attribute>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute>
        <name ns="">help</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.image" combine="interleave">
    <optional>
      <attribute>
        <name ns="">states</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="separator">
    <element>
      <name ns="">separator</name>
      <ref name="attlist.separator"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="">
        <name ns="">string</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <choice>
      <attribute>
        <name ns="">name</name>
        <text/>
      </attribute>
      <attribute>
        <name ns="">name</name>
        <text/>
      </attribute>
    </choice>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute>
        <name ns="">states</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="0.0">
        <name ns="">xalign</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.separator" combine="interleave">
    <optional>
      <attribute>
        <name ns="">help</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="label">
    <element>
      <name ns="">label</name>
      <ref name="attlist.label"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="">
        <name ns="">string</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <choice>
      <attribute>
        <name ns="">name</name>
        <text/>
      </attribute>
      <attribute>
        <name ns="">name</name>
        <text/>
      </attribute>
    </choice>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute>
        <name ns="">states</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="0.0">
        <name ns="">xalign</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="0.5">
        <name ns="">yalign</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">xfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.label" combine="interleave">
    <optional>
      <attribute>
        <name ns="">help</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="newline">
    <element>
      <name ns="">newline</name>
      <ref name="attlist.newline"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.newline" combine="interleave">
    <attribute>
      <name ns="">id</name>
      <text/>
    </attribute>
  </define>
  <define name="link">
    <element>
      <name ns="">link</name>
      <ref name="attlist.link"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.link" combine="interleave">
    <attribute>
      <name ns="">name</name>
      <text/>
    </attribute>
  </define>
  <define name="attlist.link" combine="interleave">
    <optional>
      <attribute>
        <name ns="">id</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.link" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.link" combine="interleave">
    <optional>
      <attribute>
        <name ns="">states</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.link" combine="interleave">
    <optional>
      <attribute>
        <name ns="">icon</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.link" combine="interleave">
    <optional>
      <attribute a:defaultValue="show">
        <name ns="">empty</name>
        <choice>
          <value>show</value>
          <value>hide</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="notebook">
    <element>
      <name ns="">notebook</name>
      <ref name="attlist.notebook"/>
      <zeroOrMore>
        <ref name="page"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.notebook" combine="interleave">
    <optional>
      <attribute a:defaultValue="4">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="page">
    <element>
      <name ns="">page</name>
      <ref name="attlist.page"/>
      <zeroOrMore>
        <choice>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="label"/>
          <ref name="newline"/>
          <ref name="link"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="action"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute>
        <name ns="">angle</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute a:defaultValue="Unknown">
        <name ns="">string</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <optional>
      <attribute a:defaultValue="4">
        <name ns="">col</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.page" combine="interleave">
    <choice>
      <attribute>
        <name ns="">name</name>
        <text/>
      </attribute>
      <attribute>
        <name ns="">id</name>
        <text/>
      </attribute>
    </choice>
  </define>
  <define name="group">
    <element>
      <name ns="">group</name>
      <ref name="attlist.group"/>
      <zeroOrMore>
        <choice>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="label"/>
          <ref name="newline"/>
          <ref name="link"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="action"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute>
        <name ns="">string</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">yexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">yfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="0.5">
        <name ns="">yalign</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="0">
        <name ns="">xexpand</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">xfill</name>
        <choice>
          <value>0</value>
          <value>1</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="0.5">
        <name ns="">xalign</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">rowspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <optional>
      <attribute a:defaultValue="4">
        <name ns="">col</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.group" combine="interleave">
    <attribute>
      <name ns="">id</name>
      <text/>
    </attribute>
  </define>
  <define name="hpaned">
    <element>
      <name ns="">hpaned</name>
      <ref name="attlist.paned"/>
      <zeroOrMore>
        <ref name="child"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="vpaned">
    <element>
      <name ns="">vpaned</name>
      <ref name="attlist.paned"/>
      <zeroOrMore>
        <ref name="child"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.paned" combine="interleave">
    <optional>
      <attribute a:defaultValue="4">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.paned" combine="interleave">
    <optional>
      <attribute>
        <name ns="">position</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="attlist.paned" combine="interleave">
    <attribute>
      <name ns="">id</name>
      <text/>
    </attribute>
  </define>
  <define name="child">
    <element>
      <name ns="">child</name>
      <ref name="attlist.child"/>
      <zeroOrMore>
        <choice>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="label"/>
          <ref name="newline"/>
          <ref name="link"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="action"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.child" combine="interleave">
    <attribute>
      <name ns="">id</name>
      <text/>
    </attribute>
  </define>
  <define name="data">
    <element>
      <name ns="">data</name>
      <ref name="attlist.data"/>
      <oneOrMore>
        <ref name="xpath"/>
      </oneOrMore>
    </element>
  </define>
  <define name="attlist.data" combine="interleave">
    <empty/>
  </define>
  <define name="xpath">
    <element>
      <name ns="">xpath</name>
      <ref name="attlist.xpath"/>
      <zeroOrMore>
        <choice>
          <ref name="image"/>
          <ref name="separator"/>
          <ref name="label"/>
          <ref name="newline"/>
          <ref name="link"/>
          <ref name="notebook"/>
          <ref name="group"/>
          <ref name="hpaned"/>
          <ref name="vpaned"/>
          <ref name="action"/>
          <ref name="page"/>
          <ref name="child"/>
          <ref name="board"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="attlist.xpath" combine="interleave">
    <attribute>
      <name ns="">expr</name>
      <text/>
    </attribute>
  </define>
  <define name="attlist.xpath" combine="interleave">
    <optional>
      <attribute a:defaultValue="inside">
        <name ns="">position</name>
        <choice>
          <value>inside</value>
          <value>replace</value>
          <value>replace_attributes</value>
          <value>after</value>
          <value>before</value>
        </choice>
      </attribute>
    </optional>
  </define>
  <define name="action">
    <element>
      <name ns="">action</name>
      <ref name="attlist.action"/>
      <empty/>
    </element>
  </define>
  <define name="attlist.action" combine="interleave">
    <attribute>
      <name ns="">name</name>
      <text/>
    </attribute>
  </define>
  <define name="attlist.action" combine="interleave">
    <optional>
      <attribute a:defaultValue="1">
        <name ns="">colspan</name>
        <text/>
      </attribute>
    </optional>
  </define>
  <define name="label" combine="choice">
    <notAllowed/>
  </define>
  <start>
    <choice>
      <ref name="data"/>
      <ref name="board"/>
      <ref name="label"/>
    </choice>
  </start>
</grammar>
