<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <!-- $Id: simple2zoom.rnc,v 1.10 2007/09/14 14:35:40 mike Exp $ -->
  <!-- Simple2ZOOM configuration XML is not in any namespace. -->
  <start>
    <element name="client">
      <optional>
        <element name="authentication">
          <text/>
        </element>
      </optional>
      <zeroOrMore>
        <ref name="database"/>
      </zeroOrMore>
      <optional>
        <ref name="search"/>
      </optional>
    </element>
  </start>
  <define name="database">
    <element name="database">
      <attribute name="name"/>
      <element name="zurl">
        <text/>
      </element>
      <optional>
        <element name="resultsetid">
          <choice>
            <value>id</value>
            <value>search</value>
            <value>fallback</value>
          </choice>
        </element>
      </optional>
      <optional>
        <element name="nonamedresultsets">
          <empty/>
        </element>
      </optional>
      <zeroOrMore>
        <ref name="option"/>
      </zeroOrMore>
      <optional>
        <element name="charset">
          <text/>
        </element>
      </optional>
      <optional>
        <ref name="search"/>
      </optional>
      <zeroOrMore>
        <ref name="schema"/>
      </zeroOrMore>
      <optional>
        <element name="sutrs-record">
          <zeroOrMore>
            <ref name="field"/>
          </zeroOrMore>
        </element>
      </optional>
      <optional>
        <element name="usmarc-record">
          <zeroOrMore>
            <ref name="field"/>
          </zeroOrMore>
        </element>
      </optional>
      <optional>
        <element name="grs1-record">
          <zeroOrMore>
            <ref name="field"/>
          </zeroOrMore>
        </element>
      </optional>
    </element>
  </define>
  <define name="option">
    <element name="option">
      <attribute name="name"/>
      <text/>
    </element>
  </define>
  <define name="search">
    <element name="search">
      <element name="querytype">
        <value>cql</value>
      </element>
      <zeroOrMore>
        <ref name="map"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="map">
    <element name="map">
      <attribute name="use"/>
      <optional>
        <element name="index">
          <text/>
        </element>
      </optional>
    </element>
  </define>
  <define name="schema">
    <element name="schema">
      <attribute name="oid"/>
      <attribute name="sru"/>
      <attribute name="format"/>
      <attribute name="encoding"/>
    </element>
  </define>
  <define name="field">
    <element name="field">
      <attribute name="xpath"/>
      <text/>
    </element>
  </define>
</grammar>
