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