updated XML framework to reflect move of SRU explain from zeerex_explain filter to...
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rnc
1 # Metaproxy XML config file schemas
2 #  $Id: metaproxy.rnc,v 1.15 2007-01-08 13:07:39 marc Exp $
3
4 #   Copyright (c) 2005-2006, Index Data.
5
6 #   See the LICENSE file for details
7
8
9 # The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
10
11 # The RelaxNG XML Syntax and XML Schema are generated using 'trang':
12 # trang metaproxy.rnc metaproxy.rng 
13 # trang metaproxy.rnc metaproxy.xsd 
14
15 # Config file validation is done using 'xmllint':
16 # xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
17 # xmllint -/-schema metaproxy.xsd config-bytarget.xml
18
19 # For information on RelaxNG see http://relaxng.org 
20 # see also http://books.xmlschemata.org/relaxng/
21
22
23 namespace mp = "http://indexdata.com/metaproxy"
24
25 start |= metaproxy
26
27 include "retrievalinfo.rnc"
28
29 any = (text | element * { attribute * { text }*, any })*
30
31 metaproxy =
32   element mp:metaproxy {
33     attribute version { "1.0" },
34     element mp:start {
35             attribute route { xsd:NCName }
36     },
37     element mp:filters { filter+ }?,
38     element mp:routes { route+ }
39   }
40
41 route =
42   element mp:route {
43     attribute id { xsd:NCName },
44     filter+
45   }
46
47 filter =
48   element mp:filter {
49     filter_refid
50     | filter_auth_simple
51     | filter_backend_test
52     | filter_bounce
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_frontend_net =
88   attribute type { "frontend_net" },
89   attribute id { xsd:NCName }?,
90   attribute name { xsd:NCName }?,
91   element mp:threads { xsd:integer }?,
92   element mp:port { xsd:string },
93   element mp:timeout { xsd:integer }?
94
95 filter_http_file =
96   attribute type { "http_file" },
97   attribute id { xsd:NCName }?,
98   attribute name { xsd:NCName }?,
99   element mp:mimetypes { xsd:string },
100   element mp:area {
101     element mp:documentroot { xsd:string },
102     element mp:prefix { xsd:string }
103   }
104
105 filter_load_balance =
106   attribute type { "load_balance" },
107   attribute id { xsd:NCName }?,
108   attribute name { xsd:NCName }?
109
110 filter_log =
111   attribute type { "log" },
112   attribute id { xsd:NCName }?,
113   attribute name { xsd:NCName }?,
114   element mp:message { xsd:string }?,
115   element mp:filename { xsd:string }?,
116   element mp:category {
117     attribute init-options { xsd:boolean }?,
118     attribute request-session { xsd:boolean }?,
119     attribute response-session { xsd:boolean }?,
120     attribute apdu { xsd:boolean }?,
121     attribute request-apdu { xsd:boolean }?,
122     attribute response-apdu { xsd:boolean }?
123   }?
124
125 filter_multi =
126   attribute type { "multi" },
127   attribute id { xsd:NCName }?,
128   attribute name { xsd:NCName }?,
129   element mp:target {
130     attribute route { xsd:string },
131     xsd:string
132   }*,
133   element mp:hideunavailable { empty }?
134
135 filter_query_rewrite =
136   attribute type { "query_rewrite" },
137   attribute id { xsd:NCName }?,
138   attribute name { xsd:NCName }?,
139   element mp:xslt { 
140         attribute stylesheet { xsd:string }
141   }
142
143 filter_record_transform =
144   attribute type { "record_transform" },
145   attribute id { xsd:NCName }?,
146   attribute name { xsd:NCName }?,
147   retrievalinfo 
148
149 filter_session_shared =
150   attribute type { "session_shared" },
151   attribute id { xsd:NCName }?,
152   attribute name { xsd:NCName }?,
153   element mp:resultset {
154     attribute max { xsd:integer },
155     attribute ttl { xsd:integer }
156   },
157   element mp:session {
158     attribute ttl { xsd:integer }
159   }
160
161 filter_sru_z3950 =
162   attribute type { "sru_z3950" },
163   attribute id { xsd:NCName }?,
164   attribute name { xsd:NCName }?,
165   element mp:database {  
166      attribute name { xsd:NCName },
167      any        
168   }+
169
170 filter_virt_db =
171   attribute type { "virt_db" },
172   attribute id { xsd:NCName }?,
173   attribute name { xsd:NCName }?,
174   element mp:virtual {
175     attribute route { xsd:NCName }?,
176     element mp:database { xsd:NCName },
177     element mp:target { xsd:string }+
178   }+
179
180 filter_z3950_client =
181   attribute type { "z3950_client" },
182   attribute id { xsd:NCName }?,
183   attribute name { xsd:NCName }?,
184   element mp:timeout { xsd:integer }?
185
186 #filter_zeerex_explain =
187 #  attribute type { "zeerex_explain" },
188 #  attribute id { xsd:NCName }?,
189 #  attribute name { xsd:NCName }?,
190 #  element mp:database {  
191 #     attribute name { xsd:NCName },
192 #     any        
193 #  }+
194
195