source: josm/trunk/data/tagging-preset.xsd@ 7910

Last change on this file since 7910 was 7614, checked in by Don-vip, 10 years ago

see #10630 - add new keyvalue! match mode in the XSD

File size: 11.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/tagging-preset-1.0"
3 xmlns:tns="http://josm.openstreetmap.de/tagging-preset-1.0"
4 elementFormDefault="qualified">
5
6 <!-- Localized attributes (for example de.description are not supported
7 by xsd, so every element needs <anyAttribute/> To cover at least some common
8 errors, elements have specified prohibited attributes -->
9
10 <element name="annotations" type="tns:root" />
11 <element name="presets" type="tns:root">
12 <unique name="chunk_id">
13 <selector xpath=".//tns:chunk"/>
14 <field xpath="@id"/>
15 </unique>
16 <keyref name="chunk_ref" refer="tns:chunk_id">
17 <selector xpath=".//tns:reference"/>
18 <field xpath="@ref"/>
19 </keyref>
20 </element>
21
22 <complexType name="root">
23 <complexContent>
24 <extension base="tns:group-parent">
25 <attribute name="author" type="string" />
26 <attribute name="version" type="string" />
27 <attribute name="shortdescription" type="string" />
28 <attribute name="description" type="string" />
29 <attribute name="link" type="string" />
30
31 <anyAttribute processContents="skip" />
32 </extension>
33 </complexContent>
34 </complexType>
35
36 <complexType name="group-parent">
37 <sequence>
38 <choice minOccurs="1" maxOccurs="unbounded">
39 <element name="chunk" type="tns:chunk"/>
40 <element name="group" type="tns:group" />
41 <element name="item" type="tns:item" />
42 <element name="separator" type="tns:separator" />
43 </choice>
44 </sequence>
45 <attribute name="icon" type="string" />
46
47 <attribute name="type" use="prohibited" />
48 <attribute name="text" use="prohibited" />
49 <anyAttribute processContents="skip" />
50 </complexType>
51
52 <complexType name="group">
53 <complexContent>
54 <extension base="tns:group-parent">
55 <attribute name="name" type="string" use="required" />
56 </extension>
57 </complexContent>
58 </complexType>
59
60 <complexType name="separator" />
61
62 <complexType name="item">
63 <sequence>
64 <choice minOccurs="0" maxOccurs="unbounded">
65 <group ref="tns:optional_elements" />
66 <element name="key" type="tns:key" />
67 <element name="optional" type="tns:optional" minOccurs="0" />
68 </choice>
69 <element name="roles" type="tns:roles" minOccurs="0" maxOccurs="1" />
70 </sequence>
71 <attribute name="name" type="string" use="required" />
72 <attribute name="icon" type="string" />
73 <attribute name="type" type="string" />
74 <attribute name="name_template" type="string"/>
75 <attribute name="name_template_filter" type="string"/>
76 <attribute name="preset_name_label" type="boolean"/>
77
78 <attribute name="text" use="prohibited" />
79 <anyAttribute processContents="skip" />
80 </complexType>
81
82 <complexType name="optional">
83 <group ref="tns:optional_elements" maxOccurs="unbounded" />
84 <attribute name="text" type="string" />
85 <attribute name="text_context" type="string" />
86 </complexType>
87
88 <complexType name="chunk">
89 <choice minOccurs="1" maxOccurs="1">
90 <sequence>
91 <choice minOccurs="1" maxOccurs="unbounded">
92 <group ref="tns:optional_elements" />
93 <element name="key" type="tns:key" />
94 <element name="optional" type="tns:optional" minOccurs="0" />
95 </choice>
96 </sequence>
97 <sequence>
98 <!-- Cannot use tns:list_elements here because reference is present both in optional_elements and list_elements
99 so it violates cos-nonambig: Unique Particle Attribution :
100 <group ref="tns:list_elements" minOccurs="1" maxOccurs="unbounded" />-->
101 <element name="list_entry" type="tns:list_entry" minOccurs="1" maxOccurs="unbounded" />
102 </sequence>
103 </choice>
104 <attribute name="id" type="ID" use="required" />
105 </complexType>
106
107 <complexType name="reference">
108 <attribute name="ref" type="IDREF" use="required" />
109 </complexType>
110
111 <group name="optional_elements">
112 <choice>
113 <element name="label" type="tns:label" />
114 <element name="space" type="tns:space" />
115 <element name="link" type="tns:link" />
116 <element name="preset_link" type="tns:preset_link" />
117 <element name="text" type="tns:text" />
118 <element name="combo" type="tns:combo" />
119 <element name="multiselect" type="tns:multiselect" />
120 <element name="checkgroup" type="tns:checkgroup" />
121 <element name="check" type="tns:check" />
122 <element name="item_separator" type="tns:separator" />
123 <element name="reference" type="tns:reference" />
124 </choice>
125 </group>
126
127 <group name="list_elements">
128 <choice>
129 <element name="list_entry" type="tns:list_entry" />
130 <element name="reference" type="tns:reference" />
131 </choice>
132 </group>
133
134 <complexType name="key">
135 <attribute name="key" type="string" use="required" />
136 <attribute name="value" type="string" />
137 <attribute name="match" type="string" />
138 </complexType>
139
140 <complexType name="link">
141 <attribute name="href" type="string" use="required" />
142 <attribute name="text" type="string" />
143 <attribute name="text_context" type="string" />
144
145 <attribute name="name" use="prohibited" />
146 <anyAttribute processContents="skip" />
147 </complexType>
148
149 <complexType name="preset_link">
150 <attribute name="preset_name" type="string" use="required" />
151 <attribute name="name" use="prohibited" />
152 </complexType>
153
154 <complexType name="label">
155 <attribute name="text" type="string" use="required" />
156 <attribute name="text_context" type="string" />
157 <attribute name="icon" type="string" />
158 <attribute name="icon_size" type="integer" />
159
160 <attribute name="name" use="prohibited" />
161 <anyAttribute processContents="skip" />
162 </complexType>
163
164 <complexType name="space" />
165
166 <complexType name="text">
167 <attribute name="key" type="string" use="required" />
168 <attribute name="text" type="string" />
169 <attribute name="text_context" type="string" />
170 <attribute name="default" type="string" />
171 <attribute name="use_last_as_default" type="tns:last_default" />
172 <attribute name="auto_increment" type="string" />
173 <attribute name="match" type="tns:match" />
174 <attribute name="length" type="positiveInteger" />
175 <attribute name="alternative_autocomplete_keys" type="string" />
176
177 <attribute name="type" use="prohibited" />
178 <attribute name="name" use="prohibited" />
179 <attribute name="value" use="prohibited" />
180 <attribute name="values" use="prohibited" />
181 <anyAttribute processContents="skip" />
182 </complexType>
183
184 <complexType name="list_entry">
185 <attribute name="value" type="string" use="required" />
186 <attribute name="value_context" type="string" />
187 <attribute name="display_value" type="string" />
188 <attribute name="short_description" type="string" />
189 <attribute name="icon" type="string" />
190 <attribute name="icon_size" type="integer" />
191 <anyAttribute processContents="skip" />
192 </complexType>
193
194 <complexType name="combo">
195 <!-- use either list_entry's or a combination of values/display_values -->
196 <sequence>
197 <group ref="tns:list_elements" minOccurs="0" maxOccurs="unbounded" />
198 </sequence>
199 <attribute name="key" type="string" use="required" />
200 <attribute name="text" type="string" />
201 <attribute name="text_context" type="string" />
202 <attribute name="values" type="string" />
203 <attribute name="values_from" type="string" />
204 <attribute name="values_context" type="string" />
205 <attribute name="display_values" type="string" />
206 <attribute name="values_searchable" type="boolean" />
207 <attribute name="default" type="string" />
208 <attribute name="use_last_as_default" type="tns:last_default" />
209 <attribute name="delimiter" type="string" />
210 <attribute name="editable" type="boolean" />
211 <attribute name="match" type="tns:match" />
212 <attribute name="length" type="positiveInteger" />
213
214 <attribute name="type" use="prohibited" />
215 <attribute name="value" use="prohibited" />
216 <attribute name="name" use="prohibited" />
217 <attribute name="delete-if-empty" use="prohibited" />
218 <attribute name="display-values" use="prohibited" />
219 <anyAttribute processContents="skip" />
220 </complexType>
221
222 <complexType name="multiselect">
223 <!-- use either list_entry's or a combination of values/display_values -->
224 <sequence>
225 <group ref="tns:list_elements" minOccurs="0" maxOccurs="unbounded" />
226 </sequence>
227 <attribute name="key" type="string" use="required" />
228 <attribute name="text" type="string" />
229 <attribute name="text_context" type="string" />
230 <attribute name="values" type="string" />
231 <attribute name="values_from" type="string" />
232 <attribute name="values_context" type="string" />
233 <attribute name="display_values" type="string" />
234 <attribute name="values_searchable" type="boolean" />
235 <attribute name="default" type="string" />
236 <attribute name="use_last_as_default" type="tns:last_default" />
237 <attribute name="delimiter" type="string" />
238 <attribute name="match" type="tns:match" />
239
240 <attribute name="type" use="prohibited" />
241 <attribute name="value" use="prohibited" />
242 <attribute name="name" use="prohibited" />
243 <attribute name="delete-if-empty" use="prohibited" />
244 <attribute name="display-values" use="prohibited" />
245 <anyAttribute processContents="skip" />
246 </complexType>
247
248 <complexType name="checkgroup">
249 <sequence>
250 <choice minOccurs="1" maxOccurs="unbounded">
251 <element name="check" type="tns:check" />
252 </choice>
253 </sequence>
254 <attribute name="columns" type="positiveInteger" />
255 <anyAttribute processContents="skip" />
256 </complexType>
257
258 <complexType name="check">
259 <attribute name="key" type="string" use="required" />
260 <attribute name="text" type="string" />
261 <attribute name="text_context" type="string" />
262 <attribute name="default" type="tns:check_default" />
263 <attribute name="value_on" type="string" />
264 <attribute name="value_off" type="string" />
265 <attribute name="disable_off" type="boolean" />
266 <attribute name="match" type="tns:match" />
267
268 <attribute name="name" use="prohibited" />
269 <attribute name="type" use="prohibited" />
270 <attribute name="value" use="prohibited" />
271 <anyAttribute processContents="skip" />
272 </complexType>
273
274 <simpleType name="check_default">
275 <restriction base="string">
276 <enumeration value="on" />
277 <enumeration value="off" />
278 </restriction>
279 </simpleType>
280
281 <simpleType name="last_default">
282 <restriction base="string">
283 <enumeration value="true" />
284 <enumeration value="false" />
285 <enumeration value="force" />
286 </restriction>
287 </simpleType>
288
289 <simpleType name="match">
290 <restriction base="string">
291 <enumeration value="none" />
292 <enumeration value="key" />
293 <enumeration value="key!" />
294 <enumeration value="keyvalue" />
295 <enumeration value="keyvalue!" />
296 </restriction>
297 </simpleType>
298
299 <complexType name="roles">
300 <sequence>
301 <element name="role" type="tns:role" minOccurs="1" maxOccurs="unbounded" />
302 </sequence>
303 </complexType>
304
305 <complexType name="role">
306 <attribute name="key" type="string" />
307 <attribute name="text" type="string" />
308 <attribute name="text_context" type="string" />
309 <attribute name="requisite" type="tns:role_requisite" />
310 <attribute name="type" type="string" />
311 <attribute name="count" type="integer" />
312 <attribute name="member_expression" type="string" />
313 <anyAttribute processContents="skip" />
314 </complexType>
315
316 <simpleType name="role_requisite">
317 <restriction base="string">
318 <enumeration value="required" />
319 <enumeration value="optional" />
320 </restriction>
321 </simpleType>
322
323</schema>
Note: See TracBrowser for help on using the repository browser.