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