Added schema xsd and rng that are auto-generated by trang.
authorAdam Dickmeiss <adam@indexdata.dk>
Sun, 8 Jun 2008 20:10:14 +0000 (22:10 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Sun, 8 Jun 2008 20:10:14 +0000 (22:10 +0200)
Added schema xsd and rng that are auto-generated by trang. But trang
is still broken on Debian lenny.. We will remove these again (and
auto-generate) if trang becomes operational again.

xml/schema/.gitignore
xml/schema/metaproxy.rng [new file with mode: 0644]
xml/schema/metaproxy.xsd [new file with mode: 0644]
xml/schema/retrievalinfo.rng [new file with mode: 0644]
xml/schema/retrievalinfo.xsd [new file with mode: 0644]

index 3ba612e..282522d 100644 (file)
@@ -1,6 +1,2 @@
 Makefile
 Makefile.in
-metaproxy.rng
-metaproxy.xsd
-retrievalinfo.rng
-retrievalinfo.xsd
diff --git a/xml/schema/metaproxy.rng b/xml/schema/metaproxy.rng
new file mode 100644 (file)
index 0000000..077fd86
--- /dev/null
@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Metaproxy XML config file schemas
+  
+    Copyright (c) 2005-2008 Index Data.
+  
+    See the LICENSE file for details
+  
+  
+  The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
+  
+  The RelaxNG XML Syntax and XML Schema are generated using 'trang':
+  trang metaproxy.rnc metaproxy.rng 
+  trang metaproxy.rnc metaproxy.xsd 
+  
+  Config file validation is done using 'xmllint':
+  xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
+  xmllint -/-schema metaproxy.xsd config-bytarget.xml
+  
+  For information on RelaxNG see http://relaxng.org 
+  see also http://books.xmlschemata.org/relaxng/
+-->
+<grammar xmlns:mp="http://indexdata.com/metaproxy" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <start combine="choice">
+    <ref name="metaproxy"/>
+  </start>
+  <include href="retrievalinfo.rng"/>
+  <define name="any">
+    <zeroOrMore>
+      <choice>
+        <text/>
+        <element>
+          <anyName/>
+          <zeroOrMore>
+            <attribute>
+              <anyName/>
+            </attribute>
+          </zeroOrMore>
+          <ref name="any"/>
+        </element>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="metaproxy">
+    <element name="mp:metaproxy">
+      <attribute name="version">
+        <value>1.0</value>
+      </attribute>
+      <element name="mp:start">
+        <attribute name="route">
+          <data type="NCName"/>
+        </attribute>
+      </element>
+      <optional>
+        <element name="mp:filters">
+          <oneOrMore>
+            <ref name="filter"/>
+          </oneOrMore>
+        </element>
+      </optional>
+      <element name="mp:routes">
+        <oneOrMore>
+          <ref name="route"/>
+        </oneOrMore>
+      </element>
+    </element>
+  </define>
+  <define name="route">
+    <element name="mp:route">
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+      <oneOrMore>
+        <ref name="filter"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="filter">
+    <element name="mp:filter">
+      <choice>
+        <ref name="filter_refid"/>
+        <ref name="filter_auth_simple"/>
+        <ref name="filter_backend_test"/>
+        <ref name="filter_bounce"/>
+        <ref name="filter_cql_rpn"/>
+        <ref name="filter_frontend_net"/>
+        <ref name="filter_http_file"/>
+        <ref name="filter_load_balance"/>
+        <ref name="filter_log"/>
+        <ref name="filter_multi"/>
+        <ref name="filter_query_rewrite"/>
+        <ref name="filter_record_transform"/>
+        <ref name="filter_session_shared"/>
+        <ref name="filter_sru_z3950"/>
+        <ref name="filter_virt_db"/>
+        <ref name="filter_z3950_client"/>
+      </choice>
+      <!--    | filter_zeerex_explain -->
+    </element>
+  </define>
+  <define name="filter_refid">
+    <attribute name="refid">
+      <data type="NCName"/>
+    </attribute>
+  </define>
+  <define name="filter_auth_simple">
+    <attribute name="type">
+      <value>auth_simple</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <element name="mp:userRegister">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:targetRegister">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:discardUnauthorisedTargets">
+        <empty/>
+      </element>
+    </optional>
+  </define>
+  <define name="filter_backend_test">
+    <attribute name="type">
+      <value>backend_test</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="filter_bounce">
+    <attribute name="type">
+      <value>bounce</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="filter_cql_rpn">
+    <attribute name="type">
+      <value>cql_rpn</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <element name="mp:conversion">
+      <attribute name="file">
+        <data type="string"/>
+      </attribute>
+    </element>
+  </define>
+  <define name="filter_frontend_net">
+    <attribute name="type">
+      <value>frontend_net</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <element name="mp:threads">
+        <data type="integer"/>
+      </element>
+    </optional>
+    <oneOrMore>
+      <element name="mp:port">
+        <data type="string"/>
+      </element>
+    </oneOrMore>
+    <optional>
+      <element name="mp:timeout">
+        <data type="integer"/>
+      </element>
+    </optional>
+  </define>
+  <define name="filter_http_file">
+    <attribute name="type">
+      <value>http_file</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <element name="mp:mimetypes">
+      <data type="string"/>
+    </element>
+    <element name="mp:area">
+      <element name="mp:documentroot">
+        <data type="string"/>
+      </element>
+      <element name="mp:prefix">
+        <data type="string"/>
+      </element>
+    </element>
+  </define>
+  <define name="filter_load_balance">
+    <attribute name="type">
+      <value>load_balance</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="filter_log">
+    <attribute name="type">
+      <value>log</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <element name="mp:message">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:time-format">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:filename">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:category">
+        <optional>
+          <attribute name="user-access">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="access">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="init-options">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="request-session">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="response-session">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="apdu">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="request-apdu">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="response-apdu">
+            <data type="boolean"/>
+          </attribute>
+        </optional>
+      </element>
+    </optional>
+  </define>
+  <define name="filter_multi">
+    <attribute name="type">
+      <value>multi</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <element name="mp:target">
+        <attribute name="route">
+          <data type="string"/>
+        </attribute>
+        <data type="string"/>
+      </element>
+    </zeroOrMore>
+    <optional>
+      <element name="mp:hideunavailable">
+        <empty/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:mergetype">
+        <data type="string"/>
+      </element>
+    </optional>
+  </define>
+  <define name="filter_query_rewrite">
+    <attribute name="type">
+      <value>query_rewrite</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <element name="mp:xslt">
+      <attribute name="stylesheet">
+        <data type="string"/>
+      </attribute>
+    </element>
+  </define>
+  <define name="filter_record_transform">
+    <attribute name="type">
+      <value>record_transform</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <ref name="retrievalinfo"/>
+  </define>
+  <define name="filter_session_shared">
+    <attribute name="type">
+      <value>session_shared</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <element name="mp:resultset">
+        <attribute name="max">
+          <data type="integer"/>
+        </attribute>
+        <attribute name="ttl">
+          <data type="integer"/>
+        </attribute>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:session">
+        <attribute name="ttl">
+          <data type="integer"/>
+        </attribute>
+      </element>
+    </optional>
+  </define>
+  <define name="filter_sru_z3950">
+    <attribute name="type">
+      <value>sru_z3950</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <oneOrMore>
+      <element name="mp:database">
+        <attribute name="name">
+          <data type="NCName"/>
+        </attribute>
+        <ref name="any"/>
+      </element>
+    </oneOrMore>
+  </define>
+  <define name="filter_virt_db">
+    <attribute name="type">
+      <value>virt_db</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <oneOrMore>
+      <element name="mp:virtual">
+        <optional>
+          <attribute name="route">
+            <data type="NCName"/>
+          </attribute>
+        </optional>
+        <element name="mp:database">
+          <data type="NCName"/>
+        </element>
+        <oneOrMore>
+          <element name="mp:target">
+            <data type="string"/>
+          </element>
+        </oneOrMore>
+      </element>
+    </oneOrMore>
+  </define>
+  <define name="filter_z3950_client">
+    <attribute name="type">
+      <value>z3950_client</value>
+    </attribute>
+    <optional>
+      <attribute name="id">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="name">
+        <data type="NCName"/>
+      </attribute>
+    </optional>
+    <optional>
+      <element name="mp:timeout">
+        <data type="integer"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:default_target">
+        <data type="string"/>
+      </element>
+    </optional>
+    <optional>
+      <element name="mp:force_target">
+        <data type="string"/>
+      </element>
+    </optional>
+  </define>
+</grammar>
+<!--
+  filter_zeerex_explain =
+   attribute type { "zeerex_explain" },
+   attribute id { xsd:NCName }?,
+   attribute name { xsd:NCName }?,
+   element mp:database {  
+      attribute name { xsd:NCName },
+      any        
+   }+
+-->
diff --git a/xml/schema/metaproxy.xsd b/xml/schema/metaproxy.xsd
new file mode 100644 (file)
index 0000000..bffdbb9
--- /dev/null
@@ -0,0 +1,453 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Metaproxy XML config file schemas
+  
+    Copyright (c) 2005-2008 Index Data.
+  
+    See the LICENSE file for details
+  
+  
+  The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
+  
+  The RelaxNG XML Syntax and XML Schema are generated using 'trang':
+  trang metaproxy.rnc metaproxy.rng 
+  trang metaproxy.rnc metaproxy.xsd 
+  
+  Config file validation is done using 'xmllint':
+  xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
+  xmllint -/-schema metaproxy.xsd config-bytarget.xml
+  
+  For information on RelaxNG see http://relaxng.org 
+  see also http://books.xmlschemata.org/relaxng/
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://indexdata.com/metaproxy" xmlns:mp="http://indexdata.com/metaproxy" xmlns:y="http://indexdata.com/yaz">
+  <xs:import namespace="http://indexdata.com/yaz" schemaLocation="retrievalinfo.xsd"/>
+  <xs:complexType name="any" mixed="true">
+    <xs:sequence>
+      <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="metaproxy">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="mp:start"/>
+        <xs:element minOccurs="0" ref="mp:filters"/>
+        <xs:element ref="mp:routes"/>
+      </xs:sequence>
+      <xs:attribute name="version" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="1.0"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="start">
+    <xs:complexType>
+      <xs:attribute name="route" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="filters">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="mp:filter"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="routes">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="mp:route"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="route">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="mp:filter"/>
+      </xs:sequence>
+      <xs:attribute name="id" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="filter">
+    <xs:complexType>
+      <xs:choice minOccurs="0">
+        <xs:group ref="mp:filter_auth_simple"/>
+        <xs:element ref="mp:conversion"/>
+        <xs:group ref="mp:filter_frontend_net"/>
+        <xs:group ref="mp:filter_http_file"/>
+        <xs:group ref="mp:filter_log"/>
+        <xs:group ref="mp:filter_multi"/>
+        <xs:element ref="mp:xslt"/>
+        <xs:element ref="mp:filter_record_transform"/>
+        <xs:group ref="mp:filter_session_shared"/>
+        <xs:group ref="mp:filter_sru_z3950"/>
+        <xs:group ref="mp:filter_virt_db"/>
+        <xs:group ref="mp:filter_z3950_client"/>
+      </xs:choice>
+      <xs:attribute name="type">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="auth_simple"/>
+            <xs:enumeration value="backend_test"/>
+            <xs:enumeration value="bounce"/>
+            <xs:enumeration value="cql_rpn"/>
+            <xs:enumeration value="frontend_net"/>
+            <xs:enumeration value="http_file"/>
+            <xs:enumeration value="load_balance"/>
+            <xs:enumeration value="log"/>
+            <xs:enumeration value="multi"/>
+            <xs:enumeration value="query_rewrite"/>
+            <xs:enumeration value="record_transform"/>
+            <xs:enumeration value="session_shared"/>
+            <xs:enumeration value="sru_z3950"/>
+            <xs:enumeration value="virt_db"/>
+            <xs:enumeration value="z3950_client"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="refid" type="xs:NCName"/>
+      <xs:attribute name="id" type="xs:NCName"/>
+      <xs:attribute name="name" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_refid">
+    <xs:attribute name="refid" use="required" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_auth_simple">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="mp:userRegister"/>
+      <xs:element minOccurs="0" ref="mp:targetRegister"/>
+      <xs:element minOccurs="0" ref="mp:discardUnauthorisedTargets"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="userRegister" type="xs:string"/>
+  <xs:element name="targetRegister" type="xs:string"/>
+  <xs:element name="discardUnauthorisedTargets">
+    <xs:complexType/>
+  </xs:element>
+  <xs:attributeGroup name="filter_auth_simple">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="auth_simple"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="filter_backend_test">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="backend_test"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="filter_bounce">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="bounce"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:element name="conversion">
+    <xs:complexType>
+      <xs:attribute name="file" use="required" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_cql_rpn">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="cql_rpn"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_frontend_net">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="mp:threads"/>
+      <xs:element maxOccurs="unbounded" ref="mp:port"/>
+      <xs:element minOccurs="0" ref="mp:timeout"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="threads" type="xs:integer"/>
+  <xs:element name="port" type="xs:string"/>
+  <xs:element name="timeout" type="xs:integer"/>
+  <xs:attributeGroup name="filter_frontend_net">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="frontend_net"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_http_file">
+    <xs:sequence>
+      <xs:element ref="mp:mimetypes"/>
+      <xs:element ref="mp:area"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="mimetypes" type="xs:string"/>
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="mp:documentroot"/>
+        <xs:element ref="mp:prefix"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="documentroot" type="xs:string"/>
+  <xs:element name="prefix" type="xs:string"/>
+  <xs:attributeGroup name="filter_http_file">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="http_file"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="filter_load_balance">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="load_balance"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_log">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="mp:message"/>
+      <xs:element minOccurs="0" ref="mp:time-format"/>
+      <xs:element minOccurs="0" ref="mp:filename"/>
+      <xs:element minOccurs="0" ref="mp:category"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="message" type="xs:string"/>
+  <xs:element name="time-format" type="xs:string"/>
+  <xs:element name="filename" type="xs:string"/>
+  <xs:element name="category">
+    <xs:complexType>
+      <xs:attribute name="user-access" type="xs:boolean"/>
+      <xs:attribute name="access" type="xs:boolean"/>
+      <xs:attribute name="init-options" type="xs:boolean"/>
+      <xs:attribute name="request-session" type="xs:boolean"/>
+      <xs:attribute name="response-session" type="xs:boolean"/>
+      <xs:attribute name="apdu" type="xs:boolean"/>
+      <xs:attribute name="request-apdu" type="xs:boolean"/>
+      <xs:attribute name="response-apdu" type="xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_log">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="log"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_multi">
+    <xs:sequence>
+      <xs:element minOccurs="0" maxOccurs="unbounded" ref="mp:target"/>
+      <xs:element minOccurs="0" ref="mp:hideunavailable"/>
+      <xs:element minOccurs="0" ref="mp:mergetype"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="target">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:string">
+          <xs:attribute name="route" use="required" type="xs:string"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="hideunavailable">
+    <xs:complexType/>
+  </xs:element>
+  <xs:element name="mergetype" type="xs:string"/>
+  <xs:attributeGroup name="filter_multi">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="multi"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:element name="xslt">
+    <xs:complexType>
+      <xs:attribute name="stylesheet" use="required" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_query_rewrite">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="query_rewrite"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:element name="filter_record_transform" abstract="true">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="y:retrieval"/>
+      </xs:sequence>
+      <xs:attribute name="version" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="1.0"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_record_transform">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="record_transform"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_session_shared">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="mp:resultset"/>
+      <xs:element minOccurs="0" ref="mp:session"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="resultset">
+    <xs:complexType>
+      <xs:attribute name="max" use="required" type="xs:integer"/>
+      <xs:attribute name="ttl" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="session">
+    <xs:complexType>
+      <xs:attribute name="ttl" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_session_shared">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="session_shared"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_sru_z3950">
+    <xs:sequence>
+      <xs:element maxOccurs="unbounded" ref="mp:database"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="database">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="mp:any">
+          <xs:attribute name="name" use="required" type="xs:NCName"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_sru_z3950">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="sru_z3950"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_virt_db">
+    <xs:sequence>
+      <xs:element maxOccurs="unbounded" ref="mp:virtual"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="virtual">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="database" type="xs:NCName"/>
+        <xs:element maxOccurs="unbounded" name="target" type="xs:string"/>
+      </xs:sequence>
+      <xs:attribute name="route" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:attributeGroup name="filter_virt_db">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="virt_db"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+  <xs:group name="filter_z3950_client">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="mp:timeout"/>
+      <xs:element minOccurs="0" ref="mp:default_target"/>
+      <xs:element minOccurs="0" ref="mp:force_target"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="default_target" type="xs:string"/>
+  <xs:element name="force_target" type="xs:string"/>
+  <xs:attributeGroup name="filter_z3950_client">
+    <xs:attribute name="type" use="required">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="z3950_client"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="id" type="xs:NCName"/>
+    <xs:attribute name="name" type="xs:NCName"/>
+  </xs:attributeGroup>
+</xs:schema>
+<!--
+  filter_zeerex_explain =
+   attribute type { "zeerex_explain" },
+   attribute id { xsd:NCName }?,
+   attribute name { xsd:NCName }?,
+   element mp:database {  
+      attribute name { xsd:NCName },
+      any        
+   }+
+-->
diff --git a/xml/schema/retrievalinfo.rng b/xml/schema/retrievalinfo.rng
new file mode 100644 (file)
index 0000000..1ecb303
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Metaproxy XML config file schemas
+  
+    Copyright (c) 2005-2008 Index Data.
+  
+    See the LICENSE file for details
+  
+  
+  The RelaxNG Compact Syntax file 'retrievalinfo.rnc' is the master copy.
+  
+  The RelaxNG XML Syntax and XML Schema are generated using 'trang':
+  trang retrievalinfo.rnc retrievalinfo.rng 
+  trang retrievalinfo.rnc retrievalinfo.xsd 
+  
+  Config file validation is done using 'xmllint':
+  xmllint -/-relaxng retrievalinfo.rng retrievalinfo.xml 
+  xmllint -/-schema retrievalinfo.xsd retirevalinfo.xml
+  
+  For information on RelaxNG see http://relaxng.org 
+  see also http://books.xmlschemata.org/relaxng/
+-->
+<grammar xmlns:y="http://indexdata.com/yaz" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!--
+    need to be in different namespace then metaproxy, otherwise 
+    xslt element definition clashes in XML Schema files
+    namespace y = "http://indexdata.com/metaproxy"
+  -->
+  <start combine="choice">
+    <ref name="retrievalinfo"/>
+  </start>
+  <define name="marc">
+    <element name="y:marc">
+      <attribute name="inputformat">
+        <data type="string"/>
+      </attribute>
+      <attribute name="outputformat">
+        <data type="string"/>
+      </attribute>
+      <attribute name="inputcharset">
+        <data type="string"/>
+      </attribute>
+    </element>
+  </define>
+  <define name="xslt">
+    <element name="y:xslt">
+      <attribute name="stylesheet">
+        <data type="string"/>
+      </attribute>
+    </element>
+  </define>
+  <define name="retrievalinfo">
+    <element name="y:retrievalinfo">
+      <attribute name="version">
+        <value>1.0</value>
+      </attribute>
+      <oneOrMore>
+        <element name="y:retrieval">
+          <attribute name="syntax">
+            <data type="string"/>
+          </attribute>
+          <optional>
+            <attribute name="name">
+              <data type="string"/>
+            </attribute>
+          </optional>
+          <optional>
+            <attribute name="identifier">
+              <data type="string"/>
+            </attribute>
+          </optional>
+          <optional>
+            <!--
+              attribute backendsyntax { xsd:string }?,
+              attribute backendname { xsd:string }?,
+            -->
+            <element name="y:backend">
+              <attribute name="syntax">
+                <data type="string"/>
+              </attribute>
+              <optional>
+                <attribute name="name">
+                  <data type="string"/>
+                </attribute>
+              </optional>
+              <zeroOrMore>
+                <choice>
+                  <ref name="marc"/>
+                  <ref name="xslt"/>
+                </choice>
+              </zeroOrMore>
+            </element>
+          </optional>
+        </element>
+      </oneOrMore>
+    </element>
+  </define>
+</grammar>
diff --git a/xml/schema/retrievalinfo.xsd b/xml/schema/retrievalinfo.xsd
new file mode 100644 (file)
index 0000000..906a8e7
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Metaproxy XML config file schemas
+  
+    Copyright (c) 2005-2008 Index Data.
+  
+    See the LICENSE file for details
+  
+  
+  The RelaxNG Compact Syntax file 'retrievalinfo.rnc' is the master copy.
+  
+  The RelaxNG XML Syntax and XML Schema are generated using 'trang':
+  trang retrievalinfo.rnc retrievalinfo.rng 
+  trang retrievalinfo.rnc retrievalinfo.xsd 
+  
+  Config file validation is done using 'xmllint':
+  xmllint -/-relaxng retrievalinfo.rng retrievalinfo.xml 
+  xmllint -/-schema retrievalinfo.xsd retirevalinfo.xml
+  
+  For information on RelaxNG see http://relaxng.org 
+  see also http://books.xmlschemata.org/relaxng/
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://indexdata.com/yaz" xmlns:mp="http://indexdata.com/metaproxy" xmlns:y="http://indexdata.com/yaz">
+  <xs:import namespace="http://indexdata.com/metaproxy" schemaLocation="metaproxy.xsd"/>
+  <!--
+    need to be in different namespace then metaproxy, otherwise 
+    xslt element definition clashes in XML Schema files
+    namespace y = "http://indexdata.com/metaproxy"
+  -->
+  <xs:element name="marc">
+    <xs:complexType>
+      <xs:attribute name="inputformat" use="required" type="xs:string"/>
+      <xs:attribute name="outputformat" use="required" type="xs:string"/>
+      <xs:attribute name="inputcharset" use="required" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="xslt">
+    <xs:complexType>
+      <xs:attribute name="stylesheet" use="required" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="retrievalinfo" substitutionGroup="mp:filter_record_transform"/>
+  <xs:element name="retrieval">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="y:backend"/>
+      </xs:sequence>
+      <xs:attribute name="syntax" use="required" type="xs:string"/>
+      <xs:attribute name="name" type="xs:string"/>
+      <xs:attribute name="identifier" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="backend">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="y:marc"/>
+        <xs:element ref="y:xslt"/>
+      </xs:choice>
+      <xs:attribute name="syntax" use="required" type="xs:string"/>
+      <xs:attribute name="name" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>