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