metanorma/metanorma-cc

View on GitHub
lib/metanorma/cc/cc.rng

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<grammar ns='https://www.metanorma.org/ns/cc' xmlns="http://relaxng.org/ns/structure/1.0">
  <!--
    VERSION v1.2.1
    default namespace = "http://riboseinc.com/csd"
    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 csd additions. And we do not want that.
  -->
  <include href="relaton-cc.rng"/>
  <include href="isodoc.rng">
    <start>
      <ref name="csd-standard"/>
    </start>
    <define name="figure">
      <element name="figure">
        <ref name="FigureAttributes"/>
        <ref name="BlockAttributes"/>
        <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>
  </include>
  <define name="csd-standard">
    <element name="csd-standard">
      <ref name="Root-Attributes"/>
      <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>