<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="http://www.unhchr.ch/udhr" xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <ref name="udhr"/>
  </start>
  <define name="udhr">
    <element name="udhr">
      <attribute name="lang"/>
      <attribute name="language"/>
      <optional>
        <ref name="note"/>
      </optional>
      <ref name="title"/>
      <optional>
        <ref name="note"/>
      </optional>
      <ref name="preamble"/>
      <ref name="articles"/>
      <optional>
        <ref name="note"/>
      </optional>
    </element>
  </define>
  <define name="title">
    <element name="title">
      <text/>
    </element>
  </define>
  <define name="note">
    <element name="note">
      <oneOrMore>
        <ref name="para"/>
      </oneOrMore>
    </element>
  </define>
  <define name="preamble">
    <element name="preamble">
      <ref name="title"/>
      <oneOrMore>
        <ref name="para"/>
      </oneOrMore>
    </element>
  </define>
  <define name="preamble2">
    <element name="preamble">
      <ref name="title"/>
      <ref name="recitals"/>
      <ref name="proclamation"/>
    </element>
  </define>
  <define name="recitals">
    <element name="recital">
      <attribute name="number">
        <value>1</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>2</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>3</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>4</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>5</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>6</value>
      </attribute>
      <ref name="para"/>
    </element>
    <element name="recital">
      <attribute name="number">
        <value>7</value>
      </attribute>
      <ref name="para"/>
    </element>
  </define>
  <define name="proclamation">
    <element name="proclamation">
      <oneOrMore>
        <ref name="para"/>
      </oneOrMore>
    </element>
  </define>
  <define name="articles">
    <element name="article">
      <attribute name="number">
        <value>1</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>2</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
      <optional>
        <ref name="para"/>
      </optional>
    </element>
    <!-- in some languages the two paragraphs are merged -->
    <element name="article">
      <attribute name="number">
        <value>3</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>4</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>5</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>6</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>7</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>8</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>9</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>10</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>11</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>12</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>13</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>14</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>15</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>16</value>
      </attribute>
      <ref name="title"/>
      <ref name="three-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>17</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>18</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>19</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>20</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>21</value>
      </attribute>
      <ref name="title"/>
      <ref name="three-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>22</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>23</value>
      </attribute>
      <ref name="title"/>
      <ref name="four-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>24</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>25</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>26</value>
      </attribute>
      <ref name="title"/>
      <ref name="three-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>27</value>
      </attribute>
      <ref name="title"/>
      <ref name="two-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>28</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>29</value>
      </attribute>
      <ref name="title"/>
      <ref name="three-clauses"/>
    </element>
    <element name="article">
      <attribute name="number">
        <value>30</value>
      </attribute>
      <ref name="title"/>
      <ref name="para"/>
    </element>
  </define>
  <define name="two-clauses">
    <element name="orderedlist">
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
    </element>
  </define>
  <define name="three-clauses">
    <element name="orderedlist">
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
    </element>
  </define>
  <define name="four-clauses">
    <element name="orderedlist">
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
      <element name="listitem">
        <optional>
          <attribute name="tag"/>
        </optional>
        <ref name="para"/>
      </element>
    </element>
  </define>
  <define name="para">
    <element name="para">
      <text/>
    </element>
  </define>
</grammar>
