cea817ee6b962894eddd4a2e36aa2fc080639a6f
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rnc
1 # Metaproxy XML config file schemas
2 #  $Id: metaproxy.rnc,v 1.6 2006-11-17 14:03:47 adam 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 default namespace = "http://indexdata.dk/yp2/config/1"
23
24 start = metaproxy
25
26 metaproxy =
27   element yp2 {
28     element start {
29       attribute route { xsd:NCName }
30     },
31     element filters { filter+ }?,
32     element routes { route+ }
33   }
34
35 route =
36   element route {
37     attribute id { xsd:NCName },
38     filter+
39   }
40
41 filter =
42   element filter {
43     filter_refid
44     | filter_auth_simple
45     | filter_backend_test
46     | filter_bounce
47     | filter_frontend_net
48     | filter_http_file
49     | filter_log
50     | filter_multi
51     | filter_query_rewrite
52     | filter_record_transform
53     | filter_session_shared
54     | filter_sru_z3950
55     | filter_virt_db
56     | filter_z3950_client
57   }
58
59 filter_refid = attribute refid { xsd:NCName }
60
61 filter_auth_simple =
62   attribute type { "auth_simple" },
63   attribute id { xsd:NCName }?,
64   attribute name { xsd:NCName }?,
65   element userRegister { xsd:string }?,
66   element targetRegister { xsd:string }?,
67   element discardUnauthorisedTargets { empty }?
68
69 filter_backend_test =
70   attribute type { "backend_test" },
71   attribute id { xsd:NCName }?,
72   attribute name { xsd:NCName }?
73
74 filter_bounce =
75   attribute type { "bounce" },
76   attribute id { xsd:NCName }?,
77   attribute name { xsd:NCName }?
78
79 filter_frontend_net =
80   attribute type { "frontend_net" },
81   attribute id { xsd:NCName }?,
82   attribute name { xsd:NCName }?,
83   element threads { xsd:integer }?,
84   element port { xsd:string },
85   element timeout { xsd:integer }?
86
87 filter_http_file =
88   attribute type { "http_file" },
89   attribute id { xsd:NCName }?,
90   attribute name { xsd:NCName }?,
91   element mimetypes { xsd:string },
92   element area {
93     element documentroot { xsd:string },
94     element prefix { xsd:string }
95   }
96
97 filter_log =
98   attribute type { "log" },
99   attribute id { xsd:NCName }?,
100   attribute name { xsd:NCName }?,
101   element message { xsd:string }?,
102   element filename { xsd:string }?,
103   element category {
104     attribute init-options { xsd:boolean }?,
105     attribute request-session { xsd:boolean }?,
106     attribute response-session { xsd:boolean }?,
107     attribute apdu { xsd:boolean }?,
108     attribute request-apdu { xsd:boolean }?,
109     attribute response-apdu { xsd:boolean }?
110   }?
111
112 filter_multi =
113   attribute type { "multi" },
114   attribute id { xsd:NCName }?,
115   attribute name { xsd:NCName }?,
116   element target {
117     attribute route { xsd:string },
118     xsd:string
119   }*,
120   element hideunavailable { empty }?
121
122 filter_query_rewrite =
123   attribute type { "query_rewrite" },
124   attribute id { xsd:NCName }?,
125   attribute name { xsd:NCName }?,
126   element xslt { xsd:string }
127
128 filter_record_transform =
129   attribute type { "record_transform" },
130   attribute id { xsd:NCName }?,
131   attribute name { xsd:NCName }?,
132   retrievalinfo 
133
134 filter_session_shared =
135   attribute type { "session_shared" },
136   attribute id { xsd:NCName }?,
137   attribute name { xsd:NCName }?,
138   element resultset {
139     attribute max { xsd:integer },
140     attribute ttl { xsd:integer }
141   },
142   element session {
143     attribute ttl { xsd:integer }
144   }
145
146 filter_sru_z3950 =
147   attribute type { "sru_z3950" },
148   attribute id { xsd:NCName }?,
149   attribute name { xsd:NCName }?
150
151 filter_virt_db =
152   attribute type { "virt_db" },
153   attribute id { xsd:NCName }?,
154   attribute name { xsd:NCName }?,
155   element virtual {
156     attribute route { xsd:NCName }?,
157     element database { xsd:NCName },
158     element target { xsd:string }+
159   }+
160
161 filter_z3950_client =
162   attribute type { "z3950_client" },
163   attribute id { xsd:NCName }?,
164   attribute name { xsd:NCName }?,
165   element timeout { xsd:integer }?
166
167 retrievalinfo = 
168   element retrievalinfo { 
169     element retrieval {
170       attribute syntax { xsd:string },
171       attribute name { xsd:string }?,
172       attribute identifier { xsd:string }?,
173       attribute backendsyntax { xsd:string }?,
174       attribute backendname { xsd:string }?,
175       element convert {
176         element marc {
177           attribute inputformat { xsd:string },
178           attribute outputformat { xsd:string },
179           attribute inputcharset { xsd:string }
180         },
181         element xslt {
182           attribute stylesheet { xsd:string }
183         }?
184       }?
185     }+
186   }