077fd8678b75d5c6f908c371e2f3304c2c56b350
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rng
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   Metaproxy XML config file schemas
4   
5     Copyright (c) 2005-2008 Index Data.
6   
7     See the LICENSE file for details
8   
9   
10   The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
11   
12   The RelaxNG XML Syntax and XML Schema are generated using 'trang':
13   trang metaproxy.rnc metaproxy.rng 
14   trang metaproxy.rnc metaproxy.xsd 
15   
16   Config file validation is done using 'xmllint':
17   xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
18   xmllint -/-schema metaproxy.xsd config-bytarget.xml
19   
20   For information on RelaxNG see http://relaxng.org 
21   see also http://books.xmlschemata.org/relaxng/
22 -->
23 <grammar xmlns:mp="http://indexdata.com/metaproxy" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
24   <start combine="choice">
25     <ref name="metaproxy"/>
26   </start>
27   <include href="retrievalinfo.rng"/>
28   <define name="any">
29     <zeroOrMore>
30       <choice>
31         <text/>
32         <element>
33           <anyName/>
34           <zeroOrMore>
35             <attribute>
36               <anyName/>
37             </attribute>
38           </zeroOrMore>
39           <ref name="any"/>
40         </element>
41       </choice>
42     </zeroOrMore>
43   </define>
44   <define name="metaproxy">
45     <element name="mp:metaproxy">
46       <attribute name="version">
47         <value>1.0</value>
48       </attribute>
49       <element name="mp:start">
50         <attribute name="route">
51           <data type="NCName"/>
52         </attribute>
53       </element>
54       <optional>
55         <element name="mp:filters">
56           <oneOrMore>
57             <ref name="filter"/>
58           </oneOrMore>
59         </element>
60       </optional>
61       <element name="mp:routes">
62         <oneOrMore>
63           <ref name="route"/>
64         </oneOrMore>
65       </element>
66     </element>
67   </define>
68   <define name="route">
69     <element name="mp:route">
70       <attribute name="id">
71         <data type="NCName"/>
72       </attribute>
73       <oneOrMore>
74         <ref name="filter"/>
75       </oneOrMore>
76     </element>
77   </define>
78   <define name="filter">
79     <element name="mp:filter">
80       <choice>
81         <ref name="filter_refid"/>
82         <ref name="filter_auth_simple"/>
83         <ref name="filter_backend_test"/>
84         <ref name="filter_bounce"/>
85         <ref name="filter_cql_rpn"/>
86         <ref name="filter_frontend_net"/>
87         <ref name="filter_http_file"/>
88         <ref name="filter_load_balance"/>
89         <ref name="filter_log"/>
90         <ref name="filter_multi"/>
91         <ref name="filter_query_rewrite"/>
92         <ref name="filter_record_transform"/>
93         <ref name="filter_session_shared"/>
94         <ref name="filter_sru_z3950"/>
95         <ref name="filter_virt_db"/>
96         <ref name="filter_z3950_client"/>
97       </choice>
98       <!--    | filter_zeerex_explain -->
99     </element>
100   </define>
101   <define name="filter_refid">
102     <attribute name="refid">
103       <data type="NCName"/>
104     </attribute>
105   </define>
106   <define name="filter_auth_simple">
107     <attribute name="type">
108       <value>auth_simple</value>
109     </attribute>
110     <optional>
111       <attribute name="id">
112         <data type="NCName"/>
113       </attribute>
114     </optional>
115     <optional>
116       <attribute name="name">
117         <data type="NCName"/>
118       </attribute>
119     </optional>
120     <optional>
121       <element name="mp:userRegister">
122         <data type="string"/>
123       </element>
124     </optional>
125     <optional>
126       <element name="mp:targetRegister">
127         <data type="string"/>
128       </element>
129     </optional>
130     <optional>
131       <element name="mp:discardUnauthorisedTargets">
132         <empty/>
133       </element>
134     </optional>
135   </define>
136   <define name="filter_backend_test">
137     <attribute name="type">
138       <value>backend_test</value>
139     </attribute>
140     <optional>
141       <attribute name="id">
142         <data type="NCName"/>
143       </attribute>
144     </optional>
145     <optional>
146       <attribute name="name">
147         <data type="NCName"/>
148       </attribute>
149     </optional>
150   </define>
151   <define name="filter_bounce">
152     <attribute name="type">
153       <value>bounce</value>
154     </attribute>
155     <optional>
156       <attribute name="id">
157         <data type="NCName"/>
158       </attribute>
159     </optional>
160     <optional>
161       <attribute name="name">
162         <data type="NCName"/>
163       </attribute>
164     </optional>
165   </define>
166   <define name="filter_cql_rpn">
167     <attribute name="type">
168       <value>cql_rpn</value>
169     </attribute>
170     <optional>
171       <attribute name="id">
172         <data type="NCName"/>
173       </attribute>
174     </optional>
175     <optional>
176       <attribute name="name">
177         <data type="NCName"/>
178       </attribute>
179     </optional>
180     <element name="mp:conversion">
181       <attribute name="file">
182         <data type="string"/>
183       </attribute>
184     </element>
185   </define>
186   <define name="filter_frontend_net">
187     <attribute name="type">
188       <value>frontend_net</value>
189     </attribute>
190     <optional>
191       <attribute name="id">
192         <data type="NCName"/>
193       </attribute>
194     </optional>
195     <optional>
196       <attribute name="name">
197         <data type="NCName"/>
198       </attribute>
199     </optional>
200     <optional>
201       <element name="mp:threads">
202         <data type="integer"/>
203       </element>
204     </optional>
205     <oneOrMore>
206       <element name="mp:port">
207         <data type="string"/>
208       </element>
209     </oneOrMore>
210     <optional>
211       <element name="mp:timeout">
212         <data type="integer"/>
213       </element>
214     </optional>
215   </define>
216   <define name="filter_http_file">
217     <attribute name="type">
218       <value>http_file</value>
219     </attribute>
220     <optional>
221       <attribute name="id">
222         <data type="NCName"/>
223       </attribute>
224     </optional>
225     <optional>
226       <attribute name="name">
227         <data type="NCName"/>
228       </attribute>
229     </optional>
230     <element name="mp:mimetypes">
231       <data type="string"/>
232     </element>
233     <element name="mp:area">
234       <element name="mp:documentroot">
235         <data type="string"/>
236       </element>
237       <element name="mp:prefix">
238         <data type="string"/>
239       </element>
240     </element>
241   </define>
242   <define name="filter_load_balance">
243     <attribute name="type">
244       <value>load_balance</value>
245     </attribute>
246     <optional>
247       <attribute name="id">
248         <data type="NCName"/>
249       </attribute>
250     </optional>
251     <optional>
252       <attribute name="name">
253         <data type="NCName"/>
254       </attribute>
255     </optional>
256   </define>
257   <define name="filter_log">
258     <attribute name="type">
259       <value>log</value>
260     </attribute>
261     <optional>
262       <attribute name="id">
263         <data type="NCName"/>
264       </attribute>
265     </optional>
266     <optional>
267       <attribute name="name">
268         <data type="NCName"/>
269       </attribute>
270     </optional>
271     <optional>
272       <element name="mp:message">
273         <data type="string"/>
274       </element>
275     </optional>
276     <optional>
277       <element name="mp:time-format">
278         <data type="string"/>
279       </element>
280     </optional>
281     <optional>
282       <element name="mp:filename">
283         <data type="string"/>
284       </element>
285     </optional>
286     <optional>
287       <element name="mp:category">
288         <optional>
289           <attribute name="user-access">
290             <data type="boolean"/>
291           </attribute>
292         </optional>
293         <optional>
294           <attribute name="access">
295             <data type="boolean"/>
296           </attribute>
297         </optional>
298         <optional>
299           <attribute name="init-options">
300             <data type="boolean"/>
301           </attribute>
302         </optional>
303         <optional>
304           <attribute name="request-session">
305             <data type="boolean"/>
306           </attribute>
307         </optional>
308         <optional>
309           <attribute name="response-session">
310             <data type="boolean"/>
311           </attribute>
312         </optional>
313         <optional>
314           <attribute name="apdu">
315             <data type="boolean"/>
316           </attribute>
317         </optional>
318         <optional>
319           <attribute name="request-apdu">
320             <data type="boolean"/>
321           </attribute>
322         </optional>
323         <optional>
324           <attribute name="response-apdu">
325             <data type="boolean"/>
326           </attribute>
327         </optional>
328       </element>
329     </optional>
330   </define>
331   <define name="filter_multi">
332     <attribute name="type">
333       <value>multi</value>
334     </attribute>
335     <optional>
336       <attribute name="id">
337         <data type="NCName"/>
338       </attribute>
339     </optional>
340     <optional>
341       <attribute name="name">
342         <data type="NCName"/>
343       </attribute>
344     </optional>
345     <zeroOrMore>
346       <element name="mp:target">
347         <attribute name="route">
348           <data type="string"/>
349         </attribute>
350         <data type="string"/>
351       </element>
352     </zeroOrMore>
353     <optional>
354       <element name="mp:hideunavailable">
355         <empty/>
356       </element>
357     </optional>
358     <optional>
359       <element name="mp:mergetype">
360         <data type="string"/>
361       </element>
362     </optional>
363   </define>
364   <define name="filter_query_rewrite">
365     <attribute name="type">
366       <value>query_rewrite</value>
367     </attribute>
368     <optional>
369       <attribute name="id">
370         <data type="NCName"/>
371       </attribute>
372     </optional>
373     <optional>
374       <attribute name="name">
375         <data type="NCName"/>
376       </attribute>
377     </optional>
378     <element name="mp:xslt">
379       <attribute name="stylesheet">
380         <data type="string"/>
381       </attribute>
382     </element>
383   </define>
384   <define name="filter_record_transform">
385     <attribute name="type">
386       <value>record_transform</value>
387     </attribute>
388     <optional>
389       <attribute name="id">
390         <data type="NCName"/>
391       </attribute>
392     </optional>
393     <optional>
394       <attribute name="name">
395         <data type="NCName"/>
396       </attribute>
397     </optional>
398     <ref name="retrievalinfo"/>
399   </define>
400   <define name="filter_session_shared">
401     <attribute name="type">
402       <value>session_shared</value>
403     </attribute>
404     <optional>
405       <attribute name="id">
406         <data type="NCName"/>
407       </attribute>
408     </optional>
409     <optional>
410       <attribute name="name">
411         <data type="NCName"/>
412       </attribute>
413     </optional>
414     <optional>
415       <element name="mp:resultset">
416         <attribute name="max">
417           <data type="integer"/>
418         </attribute>
419         <attribute name="ttl">
420           <data type="integer"/>
421         </attribute>
422       </element>
423     </optional>
424     <optional>
425       <element name="mp:session">
426         <attribute name="ttl">
427           <data type="integer"/>
428         </attribute>
429       </element>
430     </optional>
431   </define>
432   <define name="filter_sru_z3950">
433     <attribute name="type">
434       <value>sru_z3950</value>
435     </attribute>
436     <optional>
437       <attribute name="id">
438         <data type="NCName"/>
439       </attribute>
440     </optional>
441     <optional>
442       <attribute name="name">
443         <data type="NCName"/>
444       </attribute>
445     </optional>
446     <oneOrMore>
447       <element name="mp:database">
448         <attribute name="name">
449           <data type="NCName"/>
450         </attribute>
451         <ref name="any"/>
452       </element>
453     </oneOrMore>
454   </define>
455   <define name="filter_virt_db">
456     <attribute name="type">
457       <value>virt_db</value>
458     </attribute>
459     <optional>
460       <attribute name="id">
461         <data type="NCName"/>
462       </attribute>
463     </optional>
464     <optional>
465       <attribute name="name">
466         <data type="NCName"/>
467       </attribute>
468     </optional>
469     <oneOrMore>
470       <element name="mp:virtual">
471         <optional>
472           <attribute name="route">
473             <data type="NCName"/>
474           </attribute>
475         </optional>
476         <element name="mp:database">
477           <data type="NCName"/>
478         </element>
479         <oneOrMore>
480           <element name="mp:target">
481             <data type="string"/>
482           </element>
483         </oneOrMore>
484       </element>
485     </oneOrMore>
486   </define>
487   <define name="filter_z3950_client">
488     <attribute name="type">
489       <value>z3950_client</value>
490     </attribute>
491     <optional>
492       <attribute name="id">
493         <data type="NCName"/>
494       </attribute>
495     </optional>
496     <optional>
497       <attribute name="name">
498         <data type="NCName"/>
499       </attribute>
500     </optional>
501     <optional>
502       <element name="mp:timeout">
503         <data type="integer"/>
504       </element>
505     </optional>
506     <optional>
507       <element name="mp:default_target">
508         <data type="string"/>
509       </element>
510     </optional>
511     <optional>
512       <element name="mp:force_target">
513         <data type="string"/>
514       </element>
515     </optional>
516   </define>
517 </grammar>
518 <!--
519   filter_zeerex_explain =
520    attribute type { "zeerex_explain" },
521    attribute id { xsd:NCName }?,
522    attribute name { xsd:NCName }?,
523    element mp:database {  
524       attribute name { xsd:NCName },
525       any        
526    }+
527 -->