245993c3eac13f980b2f0da7453b061c3a84065f
[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       <optional>
50         <element name="mp:dlpath">
51           <data type="string"/>
52         </element>
53       </optional>
54       <element name="mp:start">
55         <attribute name="route">
56           <data type="NCName"/>
57         </attribute>
58       </element>
59       <optional>
60         <element name="mp:filters">
61           <oneOrMore>
62             <ref name="filter"/>
63           </oneOrMore>
64         </element>
65       </optional>
66       <element name="mp:routes">
67         <oneOrMore>
68           <ref name="route"/>
69         </oneOrMore>
70       </element>
71     </element>
72   </define>
73   <define name="route">
74     <element name="mp:route">
75       <attribute name="id">
76         <data type="NCName"/>
77       </attribute>
78       <oneOrMore>
79         <ref name="filter"/>
80       </oneOrMore>
81     </element>
82   </define>
83   <define name="filter">
84     <element name="mp:filter">
85       <choice>
86         <ref name="filter_refid"/>
87         <ref name="filter_auth_simple"/>
88         <ref name="filter_backend_test"/>
89         <ref name="filter_bounce"/>
90         <ref name="filter_cql_rpn"/>
91         <ref name="filter_frontend_net"/>
92         <ref name="filter_http_file"/>
93         <ref name="filter_load_balance"/>
94         <ref name="filter_log"/>
95         <ref name="filter_multi"/>
96         <ref name="filter_query_rewrite"/>
97         <ref name="filter_record_transform"/>
98         <ref name="filter_session_shared"/>
99         <ref name="filter_sru_z3950"/>
100         <ref name="filter_virt_db"/>
101         <ref name="filter_z3950_client"/>
102         <ref name="filter_limit"/>
103       </choice>
104       <!--    | filter_zeerex_explain -->
105     </element>
106   </define>
107   <define name="filter_refid">
108     <attribute name="refid">
109       <data type="NCName"/>
110     </attribute>
111   </define>
112   <define name="filter_auth_simple">
113     <attribute name="type">
114       <value>auth_simple</value>
115     </attribute>
116     <optional>
117       <attribute name="id">
118         <data type="NCName"/>
119       </attribute>
120     </optional>
121     <optional>
122       <attribute name="name">
123         <data type="NCName"/>
124       </attribute>
125     </optional>
126     <optional>
127       <element name="mp:userRegister">
128         <data type="string"/>
129       </element>
130     </optional>
131     <optional>
132       <element name="mp:targetRegister">
133         <data type="string"/>
134       </element>
135     </optional>
136     <optional>
137       <element name="mp:discardUnauthorisedTargets">
138         <empty/>
139       </element>
140     </optional>
141   </define>
142   <define name="filter_backend_test">
143     <attribute name="type">
144       <value>backend_test</value>
145     </attribute>
146     <optional>
147       <attribute name="id">
148         <data type="NCName"/>
149       </attribute>
150     </optional>
151     <optional>
152       <attribute name="name">
153         <data type="NCName"/>
154       </attribute>
155     </optional>
156   </define>
157   <define name="filter_bounce">
158     <attribute name="type">
159       <value>bounce</value>
160     </attribute>
161     <optional>
162       <attribute name="id">
163         <data type="NCName"/>
164       </attribute>
165     </optional>
166     <optional>
167       <attribute name="name">
168         <data type="NCName"/>
169       </attribute>
170     </optional>
171   </define>
172   <define name="filter_cql_rpn">
173     <attribute name="type">
174       <value>cql_rpn</value>
175     </attribute>
176     <optional>
177       <attribute name="id">
178         <data type="NCName"/>
179       </attribute>
180     </optional>
181     <optional>
182       <attribute name="name">
183         <data type="NCName"/>
184       </attribute>
185     </optional>
186     <element name="mp:conversion">
187       <attribute name="file">
188         <data type="string"/>
189       </attribute>
190     </element>
191   </define>
192   <define name="filter_frontend_net">
193     <attribute name="type">
194       <value>frontend_net</value>
195     </attribute>
196     <optional>
197       <attribute name="id">
198         <data type="NCName"/>
199       </attribute>
200     </optional>
201     <optional>
202       <attribute name="name">
203         <data type="NCName"/>
204       </attribute>
205     </optional>
206     <optional>
207       <element name="mp:threads">
208         <data type="integer"/>
209       </element>
210     </optional>
211     <oneOrMore>
212       <element name="mp:port">
213         <data type="string"/>
214       </element>
215     </oneOrMore>
216     <optional>
217       <element name="mp:timeout">
218         <data type="integer"/>
219       </element>
220     </optional>
221   </define>
222   <define name="filter_http_file">
223     <attribute name="type">
224       <value>http_file</value>
225     </attribute>
226     <optional>
227       <attribute name="id">
228         <data type="NCName"/>
229       </attribute>
230     </optional>
231     <optional>
232       <attribute name="name">
233         <data type="NCName"/>
234       </attribute>
235     </optional>
236     <element name="mp:mimetypes">
237       <data type="string"/>
238     </element>
239     <element name="mp:area">
240       <element name="mp:documentroot">
241         <data type="string"/>
242       </element>
243       <element name="mp:prefix">
244         <data type="string"/>
245       </element>
246     </element>
247   </define>
248   <define name="filter_load_balance">
249     <attribute name="type">
250       <value>load_balance</value>
251     </attribute>
252     <optional>
253       <attribute name="id">
254         <data type="NCName"/>
255       </attribute>
256     </optional>
257     <optional>
258       <attribute name="name">
259         <data type="NCName"/>
260       </attribute>
261     </optional>
262   </define>
263   <define name="filter_log">
264     <attribute name="type">
265       <value>log</value>
266     </attribute>
267     <optional>
268       <attribute name="id">
269         <data type="NCName"/>
270       </attribute>
271     </optional>
272     <optional>
273       <attribute name="name">
274         <data type="NCName"/>
275       </attribute>
276     </optional>
277     <optional>
278       <element name="mp:message">
279         <data type="string"/>
280       </element>
281     </optional>
282     <optional>
283       <element name="mp:time-format">
284         <data type="string"/>
285       </element>
286     </optional>
287     <optional>
288       <element name="mp:filename">
289         <data type="string"/>
290       </element>
291     </optional>
292     <optional>
293       <element name="mp:category">
294         <optional>
295           <attribute name="user-access">
296             <data type="boolean"/>
297           </attribute>
298         </optional>
299         <optional>
300           <attribute name="access">
301             <data type="boolean"/>
302           </attribute>
303         </optional>
304         <optional>
305           <attribute name="init-options">
306             <data type="boolean"/>
307           </attribute>
308         </optional>
309         <optional>
310           <attribute name="request-session">
311             <data type="boolean"/>
312           </attribute>
313         </optional>
314         <optional>
315           <attribute name="response-session">
316             <data type="boolean"/>
317           </attribute>
318         </optional>
319         <optional>
320           <attribute name="apdu">
321             <data type="boolean"/>
322           </attribute>
323         </optional>
324         <optional>
325           <attribute name="request-apdu">
326             <data type="boolean"/>
327           </attribute>
328         </optional>
329         <optional>
330           <attribute name="response-apdu">
331             <data type="boolean"/>
332           </attribute>
333         </optional>
334       </element>
335     </optional>
336   </define>
337   <define name="filter_multi">
338     <attribute name="type">
339       <value>multi</value>
340     </attribute>
341     <optional>
342       <attribute name="id">
343         <data type="NCName"/>
344       </attribute>
345     </optional>
346     <optional>
347       <attribute name="name">
348         <data type="NCName"/>
349       </attribute>
350     </optional>
351     <zeroOrMore>
352       <element name="mp:target">
353         <attribute name="route">
354           <data type="string"/>
355         </attribute>
356         <data type="string"/>
357       </element>
358     </zeroOrMore>
359     <optional>
360       <element name="mp:hideunavailable">
361         <empty/>
362       </element>
363     </optional>
364     <optional>
365       <element name="mp:mergetype">
366         <data type="string"/>
367       </element>
368     </optional>
369   </define>
370   <define name="filter_query_rewrite">
371     <attribute name="type">
372       <value>query_rewrite</value>
373     </attribute>
374     <optional>
375       <attribute name="id">
376         <data type="NCName"/>
377       </attribute>
378     </optional>
379     <optional>
380       <attribute name="name">
381         <data type="NCName"/>
382       </attribute>
383     </optional>
384     <element name="mp:xslt">
385       <attribute name="stylesheet">
386         <data type="string"/>
387       </attribute>
388     </element>
389   </define>
390   <define name="filter_record_transform">
391     <attribute name="type">
392       <value>record_transform</value>
393     </attribute>
394     <optional>
395       <attribute name="id">
396         <data type="NCName"/>
397       </attribute>
398     </optional>
399     <optional>
400       <attribute name="name">
401         <data type="NCName"/>
402       </attribute>
403     </optional>
404     <ref name="retrievalinfo"/>
405   </define>
406   <define name="filter_session_shared">
407     <attribute name="type">
408       <value>session_shared</value>
409     </attribute>
410     <optional>
411       <attribute name="id">
412         <data type="NCName"/>
413       </attribute>
414     </optional>
415     <optional>
416       <attribute name="name">
417         <data type="NCName"/>
418       </attribute>
419     </optional>
420     <optional>
421       <element name="mp:resultset">
422         <attribute name="max">
423           <data type="integer"/>
424         </attribute>
425         <attribute name="ttl">
426           <data type="integer"/>
427         </attribute>
428       </element>
429     </optional>
430     <optional>
431       <element name="mp:session">
432         <attribute name="ttl">
433           <data type="integer"/>
434         </attribute>
435       </element>
436     </optional>
437   </define>
438   <define name="filter_sru_z3950">
439     <attribute name="type">
440       <value>sru_z3950</value>
441     </attribute>
442     <optional>
443       <attribute name="id">
444         <data type="NCName"/>
445       </attribute>
446     </optional>
447     <optional>
448       <attribute name="name">
449         <data type="NCName"/>
450       </attribute>
451     </optional>
452     <oneOrMore>
453       <element name="mp:database">
454         <attribute name="name">
455           <data type="NCName"/>
456         </attribute>
457         <ref name="any"/>
458       </element>
459     </oneOrMore>
460   </define>
461   <define name="filter_virt_db">
462     <attribute name="type">
463       <value>virt_db</value>
464     </attribute>
465     <optional>
466       <attribute name="id">
467         <data type="NCName"/>
468       </attribute>
469     </optional>
470     <optional>
471       <attribute name="name">
472         <data type="NCName"/>
473       </attribute>
474     </optional>
475     <oneOrMore>
476       <element name="mp:virtual">
477         <optional>
478           <attribute name="route">
479             <data type="NCName"/>
480           </attribute>
481         </optional>
482         <element name="mp:database">
483           <data type="NCName"/>
484         </element>
485         <oneOrMore>
486           <element name="mp:target">
487             <data type="string"/>
488           </element>
489         </oneOrMore>
490       </element>
491     </oneOrMore>
492   </define>
493   <define name="filter_z3950_client">
494     <attribute name="type">
495       <value>z3950_client</value>
496     </attribute>
497     <optional>
498       <attribute name="id">
499         <data type="NCName"/>
500       </attribute>
501     </optional>
502     <optional>
503       <attribute name="name">
504         <data type="NCName"/>
505       </attribute>
506     </optional>
507     <optional>
508       <element name="mp:timeout">
509         <data type="integer"/>
510       </element>
511     </optional>
512     <optional>
513       <element name="mp:default_target">
514         <data type="string"/>
515       </element>
516     </optional>
517     <optional>
518       <element name="mp:force_target">
519         <data type="string"/>
520       </element>
521     </optional>
522   </define>
523   <define name="filter_limit">
524     <attribute name="type">
525       <value>limit</value>
526     </attribute>
527     <optional>
528       <element name="mp:limit">
529         <optional>
530           <attribute name="bandwidth">
531             <data type="integer"/>
532           </attribute>
533         </optional>
534         <optional>
535           <attribute name="pdu">
536             <data type="integer"/>
537           </attribute>
538         </optional>
539         <optional>
540           <attribute name="search">
541             <data type="integer"/>
542           </attribute>
543         </optional>
544         <optional>
545           <attribute name="retrieve">
546             <data type="integer"/>
547           </attribute>
548         </optional>
549       </element>
550     </optional>
551   </define>
552 </grammar>
553 <!--
554   filter_zeerex_explain =
555    attribute type { "zeerex_explain" },
556    attribute id { xsd:NCName }?,
557    attribute name { xsd:NCName }?,
558    element mp:database {  
559       attribute name { xsd:NCName },
560       any        
561    }+
562 -->