relaton/relaton-cen

View on GitHub
grammars/relaton-iso.rng

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <include href="biblio-standoc.rng">
    <define name="BibDataExtensionType">
      <optional>
        <attribute name="schema-version"/>
      </optional>
      <ref name="doctype"/>
      <optional>
        <ref name="docsubtype"/>
      </optional>
      <optional>
        <ref name="horizontal"/>
      </optional>
      <ref name="editorialgroup"/>
      <optional>
        <ref name="approvalgroup"/>
      </optional>
      <zeroOrMore>
        <ref name="ics"/>
      </zeroOrMore>
      <ref name="structuredidentifier"/>
      <optional>
        <ref name="stagename"/>
      </optional>
      <optional>
        <ref name="updates_document_type"/>
      </optional>
    </define>
    <define name="bdate">
      <element name="date">
        <attribute name="type">
          <choice>
            <ref name="BibliographicDateType"/>
            <text/>
          </choice>
        </attribute>
        <choice>
          <group>
            <element name="from">
              <ref name="ISO8601Date"/>
            </element>
            <optional>
              <element name="to">
                <ref name="ISO8601Date"/>
              </element>
            </optional>
          </group>
          <element name="on">
            <choice>
              <ref name="ISO8601Date"/>
              <value>--</value>
              <value>–</value>
            </choice>
          </element>
        </choice>
      </element>
    </define>
    <define name="organization">
      <element name="organization">
        <oneOrMore>
          <ref name="orgname"/>
        </oneOrMore>
        <optional>
          <ref name="abbreviation"/>
        </optional>
        <optional>
          <ref name="uri"/>
        </optional>
        <zeroOrMore>
          <ref name="org-identifier"/>
        </zeroOrMore>
        <zeroOrMore>
          <ref name="contact"/>
        </zeroOrMore>
        <optional>
          <ref name="technical-committee"/>
        </optional>
        <optional>
          <ref name="subcommittee"/>
        </optional>
        <optional>
          <ref name="workgroup"/>
        </optional>
        <optional>
          <ref name="secretariat"/>
        </optional>
      </element>
    </define>
    <define name="DocumentType">
      <choice>
        <value>international-standard</value>
        <value>technical-specification</value>
        <value>technical-report</value>
        <value>publicly-available-specification</value>
        <value>international-workshop-agreement</value>
        <value>guide</value>
        <value>amendment</value>
        <value>technical-corrigendum</value>
        <value>directive</value>
      </choice>
    </define>
    <define name="DocumentSubtype">
      <choice>
        <value>specification</value>
        <value>method-of-test</value>
        <value>vocabulary</value>
        <value>code-of-practice</value>
      </choice>
    </define>
    <define name="structuredidentifier">
      <element name="structuredidentifier">
        <optional>
          <attribute name="type"/>
        </optional>
        <group>
          <ref name="documentnumber"/>
          <optional>
            <ref name="tc-documentnumber"/>
          </optional>
        </group>
      </element>
    </define>
    <define name="editorialgroup">
      <element name="editorialgroup">
        <ref name="ISOProjectGroup"/>
      </element>
    </define>
  </include>
  <define name="updates_document_type">
    <element name="updates-document-type">
      <ref name="DocumentType"/>
    </element>
  </define>
  <define name="ISOProjectGroup">
    <zeroOrMore>
      <ref name="agency"/>
    </zeroOrMore>
    <oneOrMore>
      <ref name="technical-committee"/>
    </oneOrMore>
    <zeroOrMore>
      <ref name="subcommittee"/>
    </zeroOrMore>
    <zeroOrMore>
      <ref name="workgroup"/>
    </zeroOrMore>
    <optional>
      <ref name="secretariat"/>
    </optional>
  </define>
  <define name="approvalgroup">
    <element name="approvalgroup">
      <ref name="ISOProjectGroup"/>
    </element>
  </define>
  <define name="agency">
    <element name="agency">
      <text/>
    </element>
  </define>
  <define name="horizontal">
    <element name="horizontal">
      <data type="boolean"/>
    </element>
  </define>
  <define name="documentnumber">
    <element name="project-number">
      <optional>
        <attribute name="part">
          <data type="int"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="subpart">
          <data type="int"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="amendment">
          <data type="int"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="corrigendum">
          <data type="int"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="origyr">
          <ref name="ISO8601Date"/>
        </attribute>
      </optional>
      <text/>
    </element>
  </define>
  <define name="tc-documentnumber">
    <element name="tc-document-number">
      <data type="int"/>
    </element>
  </define>
  <define name="subcommittee">
    <element name="subcommittee">
      <ref name="IsoWorkgroup"/>
    </element>
  </define>
  <define name="workgroup">
    <element name="workgroup">
      <ref name="IsoWorkgroup"/>
    </element>
  </define>
  <define name="secretariat">
    <element name="secretariat">
      <text/>
    </element>
  </define>
  <define name="stagename">
    <element name="stagename">
      <optional>
        <attribute name="abbreviation"/>
      </optional>
      <text/>
    </element>
  </define>
</grammar>