6efeeae03ff67a2d0e17b0d04e680edbaa075099
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rnc
1 # Metaproxy XML config file schemas
2
3 #   Copyright (c) 2005-2008 Index Data.
4
5 #   See the LICENSE file for details
6
7
8 # The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
9
10 # The RelaxNG XML Syntax and XML Schema are generated using 'trang':
11 # trang metaproxy.rnc metaproxy.rng 
12 # trang metaproxy.rnc metaproxy.xsd 
13
14 # Config file validation is done using 'xmllint':
15 # xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
16 # xmllint -/-schema metaproxy.xsd config-bytarget.xml
17
18 # For information on RelaxNG see http://relaxng.org 
19 # see also http://books.xmlschemata.org/relaxng/
20
21
22 namespace mp = "http://indexdata.com/metaproxy"
23
24 start |= metaproxy
25
26 include "retrievalinfo.rnc"
27
28 any = (text | element * { attribute * { text }*, any })*
29
30 metaproxy =
31   element mp:metaproxy {
32     attribute version { "1.0" },
33     element mp:start {
34             attribute route { xsd:NCName }
35     },
36     element mp:filters { filter+ }?,
37     element mp:routes { route+ }
38   }
39
40 route =
41   element mp:route {
42     attribute id { xsd:NCName },
43     filter+
44   }
45
46 filter =
47   element mp:filter {
48     filter_refid
49     | filter_auth_simple
50     | filter_backend_test
51     | filter_bounce
52     | filter_cql_rpn
53     | filter_frontend_net
54     | filter_http_file
55     | filter_load_balance
56     | filter_log
57     | filter_multi
58     | filter_query_rewrite
59     | filter_record_transform
60     | filter_session_shared
61     | filter_sru_z3950
62     | filter_virt_db
63     | filter_z3950_client
64 #    | filter_zeerex_explain
65   }
66
67 filter_refid = attribute refid { xsd:NCName }
68
69 filter_auth_simple =
70   attribute type { "auth_simple" },
71   attribute id { xsd:NCName }?,
72   attribute name { xsd:NCName }?,
73   element mp:userRegister { xsd:string }?,
74   element mp:targetRegister { xsd:string }?,
75   element mp:discardUnauthorisedTargets { empty }?
76
77 filter_backend_test =
78   attribute type { "backend_test" },
79   attribute id { xsd:NCName }?,
80   attribute name { xsd:NCName }?
81
82 filter_bounce =
83   attribute type { "bounce" },
84   attribute id { xsd:NCName }?,
85   attribute name { xsd:NCName }?
86
87 filter_cql_rpn =
88   attribute type { "cql_rpn" },
89   attribute id { xsd:NCName }?,
90   attribute name { xsd:NCName }?,
91   element mp:conversion {
92     attribute  file { xsd:string }
93   }
94
95 filter_frontend_net =
96   attribute type { "frontend_net" },
97   attribute id { xsd:NCName }?,
98   attribute name { xsd:NCName }?,
99   element mp:threads { xsd:integer }?,
100   element mp:port { xsd:string }+,
101   element mp:timeout { xsd:integer }?
102
103 filter_http_file =
104   attribute type { "http_file" },
105   attribute id { xsd:NCName }?,
106   attribute name { xsd:NCName }?,
107   element mp:mimetypes { xsd:string },
108   element mp:area {
109     element mp:documentroot { xsd:string },
110     element mp:prefix { xsd:string }
111   }
112
113 filter_load_balance =
114   attribute type { "load_balance" },
115   attribute id { xsd:NCName }?,
116   attribute name { xsd:NCName }?
117
118 filter_log =
119   attribute type { "log" },
120   attribute id { xsd:NCName }?,
121   attribute name { xsd:NCName }?,
122   element mp:message { xsd:string }?,
123   element mp:time-format { xsd:string }?,
124   element mp:filename { xsd:string }?,
125   element mp:category {
126     attribute user-access { xsd:boolean }?,
127     attribute access { xsd:boolean }?,
128     attribute init-options { xsd:boolean }?,
129     attribute request-session { xsd:boolean }?,
130     attribute response-session { xsd:boolean }?,
131     attribute apdu { xsd:boolean }?,
132     attribute request-apdu { xsd:boolean }?,
133     attribute response-apdu { xsd:boolean }?
134   }?
135
136 filter_multi =
137   attribute type { "multi" },
138   attribute id { xsd:NCName }?,
139   attribute name { xsd:NCName }?,
140   element mp:target {
141     attribute route { xsd:string },
142     xsd:string
143   }*,
144   element mp:hideunavailable { empty }?,
145   element mp:mergetype { xsd:string }?
146
147 filter_query_rewrite =
148   attribute type { "query_rewrite" },
149   attribute id { xsd:NCName }?,
150   attribute name { xsd:NCName }?,
151   element mp:xslt { 
152         attribute stylesheet { xsd:string }
153   }
154
155 filter_record_transform =
156   attribute type { "record_transform" },
157   attribute id { xsd:NCName }?,
158   attribute name { xsd:NCName }?,
159   retrievalinfo 
160
161 filter_session_shared =
162   attribute type { "session_shared" },
163   attribute id { xsd:NCName }?,
164   attribute name { xsd:NCName }?,
165   element mp:resultset {
166     attribute max { xsd:integer },
167     attribute ttl { xsd:integer }
168   }?,
169   element mp:session {
170     attribute ttl { xsd:integer }
171   }?
172
173 filter_sru_z3950 =
174   attribute type { "sru_z3950" },
175   attribute id { xsd:NCName }?,
176   attribute name { xsd:NCName }?,
177   element mp:database {  
178      attribute name { xsd:NCName },
179      any        
180   }+
181
182 filter_virt_db =
183   attribute type { "virt_db" },
184   attribute id { xsd:NCName }?,
185   attribute name { xsd:NCName }?,
186   element mp:virtual {
187     attribute route { xsd:NCName }?,
188     element mp:database { xsd:NCName },
189     element mp:target { xsd:string }+
190   }+
191
192 filter_z3950_client =
193   attribute type { "z3950_client" },
194   attribute id { xsd:NCName }?,
195   attribute name { xsd:NCName }?,
196   element mp:timeout { xsd:integer }?,
197   element mp:default_target { xsd:string }?,
198   element mp:force_target { xsd:string }?
199
200 #filter_zeerex_explain =
201 #  attribute type { "zeerex_explain" },
202 #  attribute id { xsd:NCName }?,
203 #  attribute name { xsd:NCName }?,
204 #  element mp:database {  
205 #     attribute name { xsd:NCName },
206 #     any        
207 #  }+
208
209