bd94035997cae94c57cdbc7c6648f1bca6406d9a
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rnc
1 # Metaproxy XML config file schemas
2 #  $Id: metaproxy.rnc,v 1.4 2006-10-06 22:51:40 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.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_virt_db
53     | filter_z3950_client
54   }
55
56 filter_refid = attribute refid { xsd:NCName }
57
58 filter_auth_simple =
59   attribute type { "auth_simple" },
60   attribute id { xsd:NCName }?,
61   attribute name { xsd:NCName }?,
62   element userRegister { xsd:string }?,
63   element targetRegister { xsd:string }?,
64   element discardUnauthorisedTargets { empty }?
65
66 filter_backend_test =
67   attribute type { "backend_test" },
68   attribute id { xsd:NCName }?,
69   attribute name { xsd:NCName }?
70
71 filter_bounce =
72   attribute type { "bounce" },
73   attribute id { xsd:NCName }?,
74   attribute name { xsd:NCName }?
75
76 filter_frontend_net =
77   attribute type { "frontend_net" },
78   attribute id { xsd:NCName }?,
79   attribute name { xsd:NCName }?,
80   element threads { xsd:integer }?,
81   element port { xsd:string }
82
83 filter_http_file =
84   attribute type { "http_file" },
85   attribute id { xsd:NCName }?,
86   attribute name { xsd:NCName }?,
87   element mimetypes { xsd:string },
88   element area {
89     element documentroot { xsd:string },
90     element prefix { xsd:string }
91   }
92
93 filter_log =
94   attribute type { "log" },
95   attribute id { xsd:NCName }?,
96   attribute name { xsd:NCName }?,
97   element message { xsd:NCName },
98   element filename { xsd:string }?,
99   element category {
100     attribute request-session { xsd:boolean }?,
101     attribute response-session { xsd:boolean }?,
102     attribute request-apdu { xsd:boolean }?,
103     attribute response-apdu { xsd:boolean }?
104   }?
105
106 filter_multi =
107   attribute type { "multi" },
108   attribute id { xsd:NCName }?,
109   attribute name { xsd:NCName }?,
110   element target {
111     attribute route { xsd:string },
112     xsd:string
113   }*,
114   element hideunavailable { empty }?
115
116 filter_query_rewrite =
117   attribute type { "query_rewrite" },
118   attribute id { xsd:NCName }?,
119   attribute name { xsd:NCName }?,
120   element xslt { xsd:string }
121
122 filter_virt_db =
123   attribute type { "virt_db" },
124   attribute id { xsd:NCName }?,
125   attribute name { xsd:NCName }?,
126   element virtual {
127     attribute route { xsd:NCName }?,
128     element database { xsd:NCName },
129     element target { xsd:string }+
130   }+
131
132 filter_z3950_client =
133   attribute type { "z3950_client" },
134   attribute id { xsd:NCName }?,
135   attribute name { xsd:NCName }?,
136   element timeout { xsd:integer }