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

Last change on this file since 6741 was 6572, checked in by simon04, 11 years ago

see #7797 - extend presets by <preset_link preset_name="..." /> to add a link to another preset, exemplified in "Education" presets

  • Property svn:mime-type set to text/plain
File size: 10.3 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
77 <attribute name="text" use="prohibited" />
78 <anyAttribute processContents="skip" />
79 </complexType>
80
81 <complexType name="optional">
82 <group ref="tns:optional_elements" maxOccurs="unbounded" />
83 <attribute name="text" type="string" />
84 <attribute name="text_context" type="string" />
85 </complexType>
86
87 <complexType name="chunk">
88 <sequence>
89 <choice minOccurs="1" maxOccurs="unbounded">
90 <group ref="tns:optional_elements" />
91 <element name="key" type="tns:key" />
92 <element name="optional" type="tns:optional" minOccurs="0" />
93 </choice>
94 </sequence>
95 <attribute name="id" type="ID" use="required" />
96 </complexType>
97
98 <complexType name="reference">
99 <attribute name="ref" type="IDREF" use="required" />
100 </complexType>
101
102 <group name="optional_elements">
103 <choice>
104 <element name="label" type="tns:label" />
105 <element name="space" type="tns:space" />
106 <element name="link" type="tns:link" />
107 <element name="preset_link" type="tns:preset_link" />
108 <element name="text" type="tns:text" />
109 <element name="combo" type="tns:combo" />
110 <element name="multiselect" type="tns:multiselect" />
111 <element name="checkgroup" type="tns:checkgroup" />
112 <element name="check" type="tns:check" />
113 <element name="item_separator" type="tns:separator" />
114 <element name="reference" type="tns:reference" />
115 </choice>
116 </group>
117
118 <complexType name="key">
119 <attribute name="key" type="string" use="required" />
120 <attribute name="value" type="string" />
121 <attribute name="match" type="string" />
122 </complexType>
123
124
125 <complexType name="link">
126 <attribute name="href" type="string" use="required" />
127 <attribute name="text" type="string" />
128 <attribute name="text_context" type="string" />
129
130 <attribute name="name" use="prohibited" />
131 <anyAttribute processContents="skip" />
132 </complexType>
133
134 <complexType name="preset_link">
135 <attribute name="preset_name" type="string" use="required" />
136 <attribute name="name" use="prohibited" />
137 </complexType>
138
139 <complexType name="label">
140 <attribute name="text" type="string" use="required" />
141 <attribute name="text_context" type="string" />
142
143 <attribute name="name" use="prohibited" />
144 <anyAttribute processContents="skip" />
145 </complexType>
146
147 <complexType name="space" />
148
149 <complexType name="text">
150 <attribute name="key" type="string" use="required" />
151 <attribute name="text" type="string" />
152 <attribute name="text_context" type="string" />
153 <attribute name="default" type="string" />
154 <attribute name="use_last_as_default" type="tns:last_default" />
155 <attribute name="auto_increment" type="string" />
156 <attribute name="match" type="tns:match" />
157 <attribute name="length" type="positiveInteger" />
158
159 <attribute name="type" use="prohibited" />
160 <attribute name="name" use="prohibited" />
161 <attribute name="value" use="prohibited" />
162 <attribute name="values" use="prohibited" />
163 <anyAttribute processContents="skip" />
164 </complexType>
165
166 <complexType name="list_entry">
167 <attribute name="value" type="string" use="required" />
168 <attribute name="value_context" type="string" />
169 <attribute name="display_value" type="string" />
170 <attribute name="short_description" type="string" />
171 <attribute name="icon" type="string" />
172 <attribute name="icon_size" type="integer" />
173 <anyAttribute processContents="skip" />
174 </complexType>
175
176 <complexType name="combo">
177 <!-- use either list_entry's or a combination of values/display_values -->
178 <sequence>
179 <element name="list_entry" type="tns:list_entry" minOccurs="0" maxOccurs="unbounded" />
180 </sequence>
181 <attribute name="key" type="string" use="required" />
182 <attribute name="text" type="string" />
183 <attribute name="text_context" type="string" />
184 <attribute name="values" type="string" />
185 <attribute name="values_from" type="string" />
186 <attribute name="values_context" type="string" />
187 <attribute name="display_values" type="string" />
188 <attribute name="values_searchable" type="boolean" />
189 <attribute name="default" type="string" />
190 <attribute name="use_last_as_default" type="tns:last_default" />
191 <attribute name="delimiter" type="string" />
192 <attribute name="editable" type="boolean" />
193 <attribute name="match" type="tns:match" />
194 <attribute name="length" type="positiveInteger" />
195
196 <attribute name="type" use="prohibited" />
197 <attribute name="value" use="prohibited" />
198 <attribute name="name" use="prohibited" />
199 <attribute name="delete-if-empty" use="prohibited" />
200 <attribute name="display-values" use="prohibited" />
201 <anyAttribute processContents="skip" />
202 </complexType>
203
204 <complexType name="multiselect">
205 <!-- use either list_entry's or a combination of values/display_values -->
206 <sequence>
207 <element name="list_entry" type="tns:list_entry" minOccurs="0" maxOccurs="unbounded" />
208 </sequence>
209 <attribute name="key" type="string" use="required" />
210 <attribute name="text" type="string" />
211 <attribute name="text_context" type="string" />
212 <attribute name="values" type="string" />
213 <attribute name="values_from" type="string" />
214 <attribute name="values_context" type="string" />
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="match" type="tns:match" />
221
222 <attribute name="type" use="prohibited" />
223 <attribute name="value" use="prohibited" />
224 <attribute name="name" use="prohibited" />
225 <attribute name="delete-if-empty" use="prohibited" />
226 <attribute name="display-values" use="prohibited" />
227 <anyAttribute processContents="skip" />
228 </complexType>
229
230 <complexType name="checkgroup">
231 <sequence>
232 <choice minOccurs="1" maxOccurs="unbounded">
233 <element name="check" type="tns:check" />
234 </choice>
235 </sequence>
236 <attribute name="columns" type="positiveInteger" />
237 <anyAttribute processContents="skip" />
238 </complexType>
239
240 <complexType name="check">
241 <attribute name="key" type="string" use="required" />
242 <attribute name="text" type="string" />
243 <attribute name="text_context" type="string" />
244 <attribute name="default" type="tns:check_default" />
245 <attribute name="value_on" type="string" />
246 <attribute name="value_off" type="string" />
247 <attribute name="match" type="tns:match" />
248
249 <attribute name="name" use="prohibited" />
250 <attribute name="type" use="prohibited" />
251 <attribute name="value" use="prohibited" />
252 <anyAttribute processContents="skip" />
253 </complexType>
254
255 <simpleType name="check_default">
256 <restriction base="string">
257 <enumeration value="on" />
258 <enumeration value="off" />
259 </restriction>
260 </simpleType>
261
262 <simpleType name="last_default">
263 <restriction base="string">
264 <enumeration value="true" />
265 <enumeration value="false" />
266 <enumeration value="force" />
267 </restriction>
268 </simpleType>
269
270 <simpleType name="match">
271 <restriction base="string">
272 <enumeration value="none" />
273 <enumeration value="key" />
274 <enumeration value="key!" />
275 <enumeration value="keyvalue" />
276 </restriction>
277 </simpleType>
278
279 <complexType name="roles">
280 <sequence>
281 <element name="role" type="tns:role" minOccurs="1" maxOccurs="unbounded" />
282 </sequence>
283 </complexType>
284
285 <complexType name="role">
286 <attribute name="key" type="string" />
287 <attribute name="text" type="string" />
288 <attribute name="text_context" type="string" />
289 <attribute name="requisite" type="tns:role_requisite" />
290 <attribute name="type" type="string" />
291 <attribute name="count" type="integer" />
292 <attribute name="member_expression" type="string" />
293 <anyAttribute processContents="skip" />
294 </complexType>
295
296 <simpleType name="role_requisite">
297 <restriction base="string">
298 <enumeration value="required" />
299 <enumeration value="optional" />
300 </restriction>
301 </simpleType>
302
303</schema>
Note: See TracBrowser for help on using the repository browser.