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

Last change on this file since 16538 was 16280, checked in by simon04, 4 years ago

fix #19022 - PresetLink: allow to customize label text and UI position

  • Property svn:eol-style set to native
File size: 13.6 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 <attribute name="baselanguage" type="string" />
31
32 <anyAttribute processContents="skip" />
33 </extension>
34 </complexContent>
35 </complexType>
36
37 <complexType name="group-parent">
38 <sequence>
39 <choice minOccurs="1" maxOccurs="unbounded">
40 <element name="chunk" type="tns:chunk"/>
41 <element name="group" type="tns:group" />
42 <element name="item" type="tns:item" />
43 <element name="separator" type="tns:separator" />
44 </choice>
45 </sequence>
46 <attribute name="icon" type="string" />
47
48 <attribute name="type" use="prohibited" />
49 <attribute name="text" use="prohibited" />
50 <anyAttribute processContents="skip" />
51 </complexType>
52
53 <complexType name="group">
54 <complexContent>
55 <extension base="tns:group-parent">
56 <attribute name="name" type="string" use="required" />
57 </extension>
58 </complexContent>
59 </complexType>
60
61 <complexType name="separator" />
62
63 <complexType name="item">
64 <sequence>
65 <choice minOccurs="0" maxOccurs="unbounded">
66 <group ref="tns:optional_elements" />
67 <element name="key" type="tns:key" />
68 <element name="optional" type="tns:optional" minOccurs="0" />
69 </choice>
70 <element name="roles" type="tns:roles" minOccurs="0" maxOccurs="1" />
71 </sequence>
72 <attribute name="name" type="string" use="required" />
73 <attribute name="icon" type="string" />
74 <attribute name="type" type="string" />
75 <attribute name="name_template" type="string"/>
76 <attribute name="name_template_filter" type="string"/>
77 <attribute name="preset_name_label" type="boolean"/>
78
79 <attribute name="text" use="prohibited" />
80 <anyAttribute processContents="skip" />
81 </complexType>
82
83 <complexType name="optional">
84 <group ref="tns:optional_elements" maxOccurs="unbounded" />
85 <attribute name="text" type="string" />
86 <attribute name="text_context" type="string" />
87 </complexType>
88
89 <complexType name="chunk">
90 <choice minOccurs="1" maxOccurs="1">
91 <sequence>
92 <choice minOccurs="1" maxOccurs="unbounded">
93 <group ref="tns:optional_elements" />
94 <element name="key" type="tns:key" />
95 <element name="optional" type="tns:optional" minOccurs="0" />
96 <element name="roles" type="tns:roles" minOccurs="0" />
97 </choice>
98 </sequence>
99 <sequence>
100 <!-- Cannot use tns:list_elements here because reference is present both in optional_elements and list_elements
101 so it violates cos-nonambig: Unique Particle Attribution :
102 <group ref="tns:list_elements" minOccurs="1" maxOccurs="unbounded" />-->
103 <element name="list_entry" type="tns:list_entry" minOccurs="1" maxOccurs="unbounded" />
104 </sequence>
105 <sequence>
106 <element name="role" type="tns:role" minOccurs="1" maxOccurs="unbounded" />
107 </sequence>
108 </choice>
109 <attribute name="id" type="ID" use="required" />
110 </complexType>
111
112 <complexType name="reference">
113 <attribute name="ref" type="IDREF" use="required" />
114 </complexType>
115
116 <group name="optional_elements">
117 <choice>
118 <element name="label" type="tns:label" />
119 <element name="space" type="tns:space" />
120 <element name="link" type="tns:link" />
121 <element name="preset_link" type="tns:preset_link" />
122 <element name="text" type="tns:text" />
123 <element name="combo" type="tns:combo" />
124 <element name="multiselect" type="tns:multiselect" />
125 <element name="checkgroup" type="tns:checkgroup" />
126 <element name="check" type="tns:check" />
127 <element name="item_separator" type="tns:separator" />
128 <element name="reference" type="tns:reference" />
129 </choice>
130 </group>
131
132 <group name="list_elements">
133 <choice>
134 <element name="list_entry" type="tns:list_entry" />
135 <element name="reference" type="tns:reference" />
136 </choice>
137 </group>
138
139 <complexType name="key">
140 <attribute name="key" type="string" use="required" />
141 <attribute name="value" type="string" />
142 <attribute name="match" type="string" />
143 </complexType>
144
145 <complexType name="link">
146 <attribute name="wiki" type="string" />
147 <attribute name="href" type="string" />
148 <attribute name="text" type="string" />
149 <attribute name="text_context" type="string" />
150
151 <attribute name="name" use="prohibited" />
152 <anyAttribute processContents="skip" />
153 </complexType>
154
155 <complexType name="preset_link">
156 <attribute name="preset_name" type="string" use="required" />
157 <attribute name="text" type="string" />
158 <attribute name="text_context" type="string" />
159 <attribute name="name" use="prohibited" />
160 </complexType>
161
162 <complexType name="label">
163 <attribute name="text" type="string" use="required" />
164 <attribute name="text_context" type="string" />
165 <attribute name="icon" type="string" />
166 <attribute name="icon_size" type="integer" />
167
168 <attribute name="name" use="prohibited" />
169 <anyAttribute processContents="skip" />
170 </complexType>
171
172 <complexType name="space" />
173
174 <complexType name="text">
175 <attribute name="key" type="string" use="required" />
176 <attribute name="text" type="string" />
177 <attribute name="text_context" type="string" />
178 <attribute name="default" type="string" />
179 <attribute name="use_last_as_default" type="tns:last_default" />
180 <attribute name="auto_increment" type="string" />
181 <attribute name="match" type="tns:match" />
182 <attribute name="length" type="positiveInteger" />
183 <attribute name="alternative_autocomplete_keys" type="string" />
184
185 <attribute name="type" use="prohibited" />
186 <attribute name="name" use="prohibited" />
187 <attribute name="value" use="prohibited" />
188 <attribute name="values" use="prohibited" />
189 <anyAttribute processContents="skip" />
190 </complexType>
191
192 <complexType name="list_entry">
193 <attribute name="value" type="string" use="required" />
194 <attribute name="value_context" type="string" />
195 <attribute name="display_value" type="string" />
196 <attribute name="short_description" type="string" />
197 <attribute name="icon" type="string" />
198 <attribute name="icon_size" type="integer" />
199 <anyAttribute processContents="skip" />
200 </complexType>
201
202 <complexType name="combo">
203 <!-- use either list_entry's or a combination of values/display_values -->
204 <sequence>
205 <group ref="tns:list_elements" minOccurs="0" maxOccurs="unbounded" />
206 </sequence>
207 <attribute name="key" type="string" use="required" />
208 <attribute name="text" type="string" />
209 <attribute name="text_context" type="string" />
210 <attribute name="values" type="string" />
211 <attribute name="values_from" type="string" />
212 <attribute name="values_context" type="string" />
213 <attribute name="values_no_i18n" type="boolean" />
214 <attribute name="values_sort" type="boolean" />
215 <attribute name="display_values" type="string" />
216 <attribute name="values_searchable" type="boolean" />
217 <attribute name="default" type="string" />
218 <attribute name="use_last_as_default" type="tns:last_default" />
219 <attribute name="delimiter" type="string" />
220 <attribute name="editable" type="boolean" />
221 <attribute name="match" type="tns:match" />
222 <attribute name="length" type="positiveInteger" />
223
224 <attribute name="type" use="prohibited" />
225 <attribute name="value" use="prohibited" />
226 <attribute name="name" use="prohibited" />
227 <attribute name="delete-if-empty" use="prohibited" />
228 <attribute name="display-values" use="prohibited" />
229 <anyAttribute processContents="skip" />
230 </complexType>
231
232 <complexType name="multiselect">
233 <!-- use either list_entry's or a combination of values/display_values -->
234 <sequence>
235 <group ref="tns:list_elements" minOccurs="0" maxOccurs="unbounded" />
236 </sequence>
237 <attribute name="key" type="string" use="required" />
238 <attribute name="text" type="string" />
239 <attribute name="text_context" type="string" />
240 <attribute name="values" type="string" />
241 <attribute name="values_from" type="string" />
242 <attribute name="values_context" type="string" />
243 <attribute name="display_values" type="string" />
244 <attribute name="values_searchable" type="boolean" />
245 <attribute name="default" type="string" />
246 <attribute name="use_last_as_default" type="tns:last_default" />
247 <attribute name="delimiter" type="string" />
248 <attribute name="match" type="tns:match" />
249
250 <attribute name="type" use="prohibited" />
251 <attribute name="value" use="prohibited" />
252 <attribute name="name" use="prohibited" />
253 <attribute name="delete-if-empty" use="prohibited" />
254 <attribute name="display-values" use="prohibited" />
255 <anyAttribute processContents="skip" />
256 </complexType>
257
258 <complexType name="checkgroup">
259 <sequence>
260 <choice minOccurs="1" maxOccurs="unbounded">
261 <element name="check" type="tns:check" />
262 </choice>
263 </sequence>
264 <attribute name="columns" type="positiveInteger" />
265 <anyAttribute processContents="skip" />
266 </complexType>
267
268 <complexType name="check">
269 <attribute name="key" type="string" use="required" />
270 <attribute name="text" type="string" />
271 <attribute name="text_context" type="string" />
272 <attribute name="default" type="tns:check_default" />
273 <attribute name="value_on" type="string" />
274 <attribute name="value_off" type="string" />
275 <attribute name="disable_off" type="boolean" />
276 <attribute name="match" type="tns:match" />
277 <attribute name="icon" type="string" />
278 <attribute name="icon_size" type="integer" />
279
280 <attribute name="name" use="prohibited" />
281 <attribute name="type" use="prohibited" />
282 <attribute name="value" use="prohibited" />
283 <anyAttribute processContents="skip" />
284 </complexType>
285
286 <simpleType name="check_default">
287 <restriction base="string">
288 <enumeration value="on" />
289 <enumeration value="off" />
290 </restriction>
291 </simpleType>
292
293 <simpleType name="last_default">
294 <restriction base="string">
295 <enumeration value="true" />
296 <enumeration value="false" />
297 <enumeration value="force" />
298 </restriction>
299 </simpleType>
300
301 <simpleType name="match">
302 <restriction base="string">
303 <enumeration value="none" />
304 <enumeration value="key" />
305 <enumeration value="key!" />
306 <enumeration value="keyvalue" />
307 <enumeration value="keyvalue!" />
308 </restriction>
309 </simpleType>
310
311 <complexType name="roles">
312 <group ref="tns:roles_elements" maxOccurs="unbounded" />
313 </complexType>
314
315 <group name="roles_elements">
316 <choice>
317 <element name="role" type="tns:role" minOccurs="1" maxOccurs="unbounded" />
318 <element name="reference" type="tns:reference" />
319 </choice>
320 </group>
321
322 <complexType name="role">
323 <attribute name="key" type="string" />
324 <attribute name="text" type="string" />
325 <attribute name="text_context" type="string" />
326 <attribute name="requisite" type="tns:role_requisite" />
327 <attribute name="type" type="string" />
328 <attribute name="count" type="integer" />
329 <attribute name="member_expression" type="string" />
330 <attribute name="regexp" type="boolean" />
331 <anyAttribute processContents="skip" />
332 </complexType>
333
334 <simpleType name="role_requisite">
335 <restriction base="string">
336 <enumeration value="required" />
337 <enumeration value="optional" />
338 </restriction>
339 </simpleType>
340
341</schema>
Note: See TracBrowser for help on using the repository browser.