<?xml version=“1.0” encoding=“UTF-8”?> <grammar ns=“www.metanorma.org/ns/m3d” xmlns=“relaxng.org/ns/structure/1.0” datatypeLibrary=“www.w3.org/2001/XMLSchema-datatypes”>

<!--
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
  we cannot have a new default namespace: we will end up with a grammar with two different
  namespaces, one for isostandard and one for csand additions. And we do not want that.
-->
<include href="isodoc.rng">
  <start>
    <ref name="m3d-standard"/>
  </start>
  <define name="figure">
    <element name="figure">
      <attribute name="id">
        <data type="ID"/>
      </attribute>
      <optional>
        <attribute name="unnumbered">
          <data type="boolean"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="number"/>
      </optional>
      <optional>
        <attribute name="subsequence"/>
      </optional>
      <optional>
        <attribute name="class"/>
      </optional>
      <optional>
        <ref name="source"/>
      </optional>
      <optional>
        <ref name="tname"/>
      </optional>
      <choice>
        <oneOrMore>
          <ref name="figure"/>
        </oneOrMore>
        <group>
          <choice>
            <zeroOrMore>
              <ref name="TextElement"/>
            </zeroOrMore>
            <ref name="pre"/>
          </choice>
          <zeroOrMore>
            <ref name="note"/>
          </zeroOrMore>
          <optional>
            <ref name="dl"/>
          </optional>
        </group>
      </choice>
    </element>
  </define>
  <define name="DocumentType">
    <choice>
      <value>guidance</value>
      <value>proposal</value>
      <value>standard</value>
      <value>report</value>
      <value>whitepaper</value>
      <value>charter</value>
      <value>policy</value>
      <value>glossary</value>
      <value>case-study</value>
    </choice>
  </define>
  <define name="editorialgroup">
    <element name="editorialgroup">
      <oneOrMore>
        <ref name="committee"/>
      </oneOrMore>
    </element>
  </define>
</include>
<define name="committee">
  <element name="committee">
    <attribute name="type">
      <choice>
        <value>technical</value>
        <value>provisional</value>
      </choice>
    </attribute>
    <text/>
  </element>
</define>
<define name="m3d-standard">
  <element name="m3d-standard">
    <attribute name="version"/>
    <attribute name="type">
      <choice>
        <value>semantic</value>
        <value>presentation</value>
      </choice>
    </attribute>
    <ref name="bibdata"/>
    <zeroOrMore>
      <ref name="termdocsource"/>
    </zeroOrMore>
    <optional>
      <ref name="misccontainer"/>
    </optional>
    <optional>
      <ref name="boilerplate"/>
    </optional>
    <ref name="preface"/>
    <oneOrMore>
      <ref name="sections"/>
    </oneOrMore>
    <zeroOrMore>
      <ref name="annex"/>
    </zeroOrMore>
    <ref name="bibliography"/>
    <zeroOrMore>
      <ref name="indexsect"/>
    </zeroOrMore>
  </element>
</define>

</grammar>