<virtual> element accepts optional "route" attribute.
[metaproxy-moved-to-github.git] / etc / config.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: config.xsd,v 1.3 2006-01-16 11:33:04 mike Exp $ -->
3 <!--
4         This Schema prescribes the format of YP2 configuration files.
5         Invoke it like this:
6                 xmllint -noout -schema config.xsd config1.xml
7         But use double-dashes for the option names instead of single.
8         (I couldn't include them literally, as, believe it or not,
9         it's an error to include a double dash in an XML comment.
10 -->
11 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
12            elementFormDefault="qualified"
13            targetNamespace="http://indexdata.dk/yp2/config/1"
14            xmlns:config="http://indexdata.dk/yp2/config/1">
15
16   <xs:element name="yp2">
17     <xs:complexType>
18       <xs:sequence>
19         <xs:element ref="config:start"/>
20         <xs:element ref="config:filters"/>
21         <xs:element ref="config:routes"/>
22       </xs:sequence>
23     </xs:complexType>
24   </xs:element>
25
26
27   <xs:element name="start">
28     <xs:complexType>
29       <!-- ### need to specify here that the element is empty -->
30       <xs:attribute name="route" use="required" type="xs:NCName"/>
31     </xs:complexType>
32   </xs:element>
33
34
35   <xs:element name="filters">
36     <xs:complexType>
37       <xs:sequence>
38         <xs:element maxOccurs="unbounded" ref="config:filter"/>
39       </xs:sequence>
40     </xs:complexType>
41   </xs:element>
42
43   <xs:element name="filter">
44     <xs:complexType>
45       <xs:choice>
46         <!-- In general, the content depends on the "type" attribute.
47              Perhaps the various filter-types' configuration
48              structures should each be described by their own little
49              subschemas? -->
50
51         <!-- type="frontend_net" -->
52         <xs:sequence>
53           <xs:element minOccurs="0" ref="config:threads"/>
54           <xs:element ref="config:port"/>
55         </xs:sequence>
56
57         <!-- type="z3950_client" -->
58         <xs:element ref="config:timeout"/>
59
60         <!-- type="log" -->
61         <xs:element ref="config:message"/>
62
63         <!-- type="virt_db" -->
64         <xs:element minOccurs="0" maxOccurs="unbounded" ref="config:virtual"/>
65
66       </xs:choice>
67       <xs:attribute name="id" type="xs:NCName"/>
68       <xs:attribute name="refid" type="xs:NCName"/>
69       <xs:attribute name="type" type="xs:NCName"/>
70     </xs:complexType>
71   </xs:element>
72
73   <xs:element name="threads" type="xs:integer"/>
74   <xs:element name="port" type="xs:string"/>
75   <xs:element name="timeout" type="xs:integer"/>
76   <xs:element name="message" type="xs:NCName"/>
77
78   <xs:element name="virtual">
79     <xs:complexType>
80       <xs:sequence>
81         <xs:element ref="config:database"/>
82         <xs:element ref="config:target"/>
83       </xs:sequence>
84       <xs:attribute name="route" type="xs:NCName"/>
85     </xs:complexType>
86   </xs:element>
87
88   <xs:element name="database" type="xs:NCName"/>
89   <xs:element name="target" type="xs:anyURI"/>
90
91
92   <xs:element name="routes">
93     <xs:complexType>
94       <xs:sequence>
95         <xs:element maxOccurs="unbounded" ref="config:route"/>
96       </xs:sequence>
97     </xs:complexType>
98   </xs:element>
99
100   <xs:element name="route">
101     <xs:complexType>
102       <xs:sequence>
103         <xs:element maxOccurs="unbounded" ref="config:filter"/>
104       </xs:sequence>
105       <xs:attribute name="id" use="required" type="xs:NCName"/>
106     </xs:complexType>
107   </xs:element>
108 </xs:schema>