<?xml version="1.0" encoding="UTF-8"?>
<!-- Voicegram Recording 1.0 — RELAX NG schema for .voice descriptors
     https://www.gnomevoice.org/standard/
     SPDX-License-Identifier: GPL-3.0-or-later -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <choice>
      <ref name="voice"/>
      <ref name="voicegrams"/>
    </choice>
  </start>

  <define name="voice">
    <element name="voice">
      <attribute name="version"><text/></attribute>
      <ref name="station"/>
    </element>
  </define>

  <define name="voicegrams">
    <element name="voicegrams">
      <zeroOrMore><ref name="voice"/></zeroOrMore>
    </element>
  </define>

  <define name="station">
    <element name="station">
      <attribute name="name"><text/></attribute>
      <optional><attribute name="uri"><data type="anyURI"/></attribute></optional>
      <ref name="location"/>
      <oneOrMore><ref name="stream"/></oneOrMore>
      <optional><element name="title"><text/></element></optional>
      <optional><element name="date"><data type="dateTime"/></element></optional>
      <optional>
        <element name="duration">
          <data type="decimal"><param name="minInclusive">0</param></data>
        </element>
      </optional>
    </element>
  </define>

  <define name="location">
    <element name="location">
      <attribute name="lat">
        <data type="decimal">
          <param name="minInclusive">-90</param>
          <param name="maxInclusive">90</param>
        </data>
      </attribute>
      <attribute name="lon">
        <data type="decimal">
          <param name="minInclusive">-180</param>
          <param name="maxInclusive">180</param>
        </data>
      </attribute>
      <text/>
    </element>
  </define>

  <define name="stream">
    <element name="stream"><data type="anyURI"/></element>
  </define>
</grammar>
