Projekt: Hesla Jednoty bratrské/2021/hes21-02.rng

hes21-02.rng

editovat

w:en: Relax NG schema pro kontrolu syntaxe XML souboru s Hesly JB.

Příklad použití pro validaci:

xmllint --noout --relaxng hes21-02.rng hes21-01.xml 2> hes21-01.errors


<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <element name="LOSFILE">
      <attribute name="dtdmainvers">
        <data type="integer"/>
      </attribute>
      <attribute name="dtdsubvers">
        <data type="integer"/>
      </attribute>
      <attribute name="year">
        <data type="integer"/>
      </attribute>
      <attribute name="xml:lang">
        <data type="NCName"/>
      </attribute>
      <element name="HEAD">
        <element name="FILEVERS">
          <text/>
        </element>
        <element name="XLAT">
          <text/>
        </element>
        <element name="SUBLANG">
          <attribute name="subcode">
            <data type="NCName"/>
          </attribute>
          <element name="TLPATTERN">
            <text/>
          </element>
          <element name="MONTHS">
            <attribute name="apr">
              <data type="NCName"/>
            </attribute>
            <attribute name="aug">
              <data type="NCName"/>
            </attribute>
            <attribute name="dec">
              <data type="NCName"/>
            </attribute>
            <attribute name="feb">
              <data type="NCName"/>
            </attribute>
            <attribute name="jan">
              <data type="NCName"/>
            </attribute>
            <attribute name="jul">
              <data type="NCName"/>
            </attribute>
            <attribute name="jun">
              <data type="NCName"/>
            </attribute>
            <attribute name="mar">
              <data type="NCName"/>
            </attribute>
            <attribute name="may">
              <data type="NCName"/>
            </attribute>
            <attribute name="nov">
              <data type="NCName"/>
            </attribute>
            <attribute name="oct">
              <data type="NCName"/>
            </attribute>
            <attribute name="sep">
              <data type="NCName"/>
            </attribute>
          </element>
          <element name="DOW">
            <attribute name="fri">
              <data type="NCName"/>
            </attribute>
            <attribute name="mon">
              <data type="NCName"/>
            </attribute>
            <attribute name="sat">
              <data type="NCName"/>
            </attribute>
            <attribute name="sun">
              <data type="NCName"/>
            </attribute>
            <attribute name="thu">
              <data type="NCName"/>
            </attribute>
            <attribute name="tue">
              <data type="NCName"/>
            </attribute>
            <attribute name="wed">
              <data type="NCName"/>
            </attribute>
          </element>
        </element>
      </element>
      <element name="YEAR">
        <attribute name="y">
          <data type="integer"/>
        </attribute>
        <ref name="TL"/>
        <ref name="S"/>
        <ref name="L"/>
        <ref name="SL"/>
      </element>
      <oneOrMore>
        <choice>
          <element name="DAY">
            <attribute name="d">
              <data type="integer"/>
            </attribute>
            <attribute name="m">
              <data type="integer"/>
            </attribute>
            <optional>
              <attribute name="meaning"/>
            </optional>
            <attribute name="name"/>
            <optional>
              <attribute name="ord">
                <data type="integer"/>
              </attribute>
            </optional>
            <attribute name="type">
              <data type="NCName"/>
            </attribute>
            <optional>
              <ref name="S"/>
              <ref name="L"/>
              <ref name="SL"/>
            </optional>
          </element>
          <element name="LOSUNG">
            <attribute name="d">
              <data type="integer"/>
            </attribute>
            <attribute name="m">
              <data type="integer"/>
            </attribute>
            <ref name="TL"/>
            <element name="OT">
              <ref name="S"/>
              <optional>
                <ref name="IL"/>
              </optional>
              <oneOrMore>
                <ref name="L"/>
              </oneOrMore>
              <ref name="SL"/>
            </element>
            <element name="NT">
              <ref name="S"/>
              <optional>
                <ref name="IL"/>
              </optional>
              <ref name="L"/>
              <ref name="SL"/>
            </element>
            <optional>
              <element name="SR">
                <ref name="SL"/>
              </element>
              <element name="CR">
                <ref name="SL"/>
              </element>
            </optional>
            <optional>
              <element name="TT">
                <oneOrMore>
                  <ref name="L"/>
                </oneOrMore>
                <ref name="SL"/>
              </element>
            </optional>
            <optional>
              <element name="Ev">
                <ref name="SL"/>
              </element>
              <element name="Ep">
                <ref name="SL"/>
              </element>
              <element name="Pr">
                <ref name="SL"/>
              </element>
            </optional>
            <optional>
              <element name="AT">
                <ref name="SL"/>
              </element>
            </optional>
            <optional>
              <element name="Bl">
                <ref name="SL"/>
              </element>
            </optional>
            <zeroOrMore>
              <element name="C">
                <ref name="L"/>
              </element>
            </zeroOrMore>
          </element>
          <element name="MONTH">
            <attribute name="m">
              <data type="integer"/>
            </attribute>
            <ref name="TL"/>
            <ref name="S"/>
            <ref name="L"/>
            <ref name="SL"/>
          </element>
        </choice>
      </oneOrMore>
    </element>
  </start>
  <define name="TL">
    <element name="TL">
      <text/>
    </element>
  </define>
  <define name="S">
    <element name="S">
      <attribute name="b">
        <data type="NMTOKEN"/>
      </attribute>
      <attribute name="ch">
        <data type="integer"/>
      </attribute>
      <attribute name="v">
        <data type="integer"/>
      </attribute>
    </element>
  </define>
  <define name="L">
    <element name="L">
      <text/>
    </element>
  </define>
  <define name="SL">
    <element name="SL">
      <text/>
    </element>
  </define>
  <define name="IL">
    <element name="IL">
      <text/>
    </element>
  </define>
</grammar>