source: josm/trunk/src/org/openstreetmap/josm/gui/tagging/tagging-preset.xsd@ 3321

Last change on this file since 3321 was 3321, checked in by jttt, 14 years ago

Validate tagging presets when they're added in Preferences dialog

  • Property svn:mime-type set to text/plain
File size: 5.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" elementFormDefault="qualified">
4
5 <!--
6 Localized attributes (for example de.description are not supported by
7 xsd, so every element needs <anyAttribute/>
8 To cover at least some common errors, elements have specified prohibited attributes
9 -->
10
11 <element name="annotations" type="tns:root"/>
12 <element name="presets" type="tns:root"/>
13
14 <complexType name="root">
15 <complexContent>
16 <extension base="tns:group">
17 <attribute name="author" type="string" />
18 <attribute name="version" type="string" />
19 <attribute name="shortdescription" type="string" />
20 <attribute name="description" type="string" />
21 <attribute name="link" type="string"/>
22
23 <anyAttribute processContents="skip"/>
24 </extension>
25 </complexContent>
26 </complexType>
27
28 <complexType name="group">
29 <sequence>
30 <choice minOccurs="1" maxOccurs="unbounded">
31 <element name="group" type="tns:group" />
32 <element name="item" type="tns:item" />
33 <element name="separator" type="tns:separator" />
34 </choice>
35 </sequence>
36 <attribute name="name" type="string" />
37 <attribute name="icon" type="string" />
38
39 <attribute name="type" use="prohibited"/>
40 <attribute name="text" use="prohibited"/>
41 <anyAttribute processContents="skip"/>
42 </complexType>
43
44 <complexType name="separator" />
45
46 <complexType name="item">
47 <sequence>
48 <choice minOccurs="0" maxOccurs="unbounded">
49 <group ref="tns:optional_elements" />
50 <element name="key" type="tns:key" />
51 <element name="optional" type="tns:optional" minOccurs="0" />
52 </choice>
53 <element name="roles" type="tns:roles" minOccurs="0" />
54 </sequence>
55 <attribute name="name" type="string" />
56 <attribute name="icon" type="string" />
57 <attribute name="type" type="string" />
58
59 <attribute name="text" use="prohibited"/>
60 <anyAttribute processContents="skip"/>
61 </complexType>
62
63 <complexType name="optional">
64 <group ref="tns:optional_elements" maxOccurs="unbounded" />
65 </complexType>
66
67 <group name="optional_elements">
68 <choice>
69 <element name="label" type="tns:label" />
70 <element name="space" type="tns:space" />
71 <element name="link" type="tns:link" />
72 <element name="text" type="tns:text" />
73 <element name="combo" type="tns:combo" />
74 <element name="check" type="tns:check" />
75 </choice>
76 </group>
77
78 <complexType name="key">
79 <attribute name="key" type="string" use="required"/>
80 <attribute name="value" type="string"/>
81 </complexType>
82
83
84 <complexType name="link">
85 <attribute name="href" type="string" use="required" />
86 <attribute name="text" type="string" />
87
88 <attribute name="name" use="prohibited"/>
89 <anyAttribute processContents="skip"/>
90 </complexType>
91
92 <complexType name="label">
93 <attribute name="text" type="string" use="required" />
94
95 <attribute name="name" use="prohibited"/>
96 <anyAttribute processContents="skip"/>
97 </complexType>
98
99 <complexType name="space" />
100
101 <complexType name="text">
102 <attribute name="key" type="string" use="required"/>
103 <attribute name="text" type="string" />
104 <attribute name="default" type="string" />
105 <attribute name="delete_if_empty" type="boolean" />
106 <attribute name="use_last_as_default" type="boolean" />
107
108 <attribute name="type" use="prohibited"/>
109 <attribute name="name" use="prohibited"/>
110 <attribute name="value" use="prohibited"/>
111 <attribute name="values" use="prohibited"/>
112 <anyAttribute processContents="skip"/>
113 </complexType>
114
115 <complexType name="combo">
116 <attribute name="key" type="string" use="required" />
117 <attribute name="text" type="string" />
118 <attribute name="values" type="string" use="required" />
119 <attribute name="default" type="string" />
120 <attribute name="editable" type="boolean" />
121 <attribute name="delete_if_empty" type="boolean" />
122 <attribute name="display_values" type="string"/>
123
124 <attribute name="type" use="prohibited"/>
125 <attribute name="value" use="prohibited"/>
126 <attribute name="name" use="prohibited"/>
127 <attribute name="delete-if-empty" use="prohibited"/>
128 <attribute name="display-values" use="prohibited"/>
129 <anyAttribute processContents="skip"/>
130 </complexType>
131
132 <complexType name="check">
133 <attribute name="key" type="string" use="required" />
134 <attribute name="text" type="string" />
135 <attribute name="default" type="tns:check_default" />
136 <attribute name="delete_if_empty" type="boolean" />
137 <attribute name="use_last_as_default" type="boolean" />
138
139 <attribute name="name" use="prohibited"/>
140 <attribute name="type" use="prohibited"/>
141 <attribute name="value" use="prohibited"/>
142 <anyAttribute processContents="skip"/>
143 </complexType>
144
145 <simpleType name="check_default">
146 <restriction base="string">
147 <enumeration value="on" />
148 <enumeration value="off" />
149 </restriction>
150 </simpleType>
151
152 <complexType name="roles">
153 <sequence>
154 <element name="role" type="tns:role" minOccurs="1" maxOccurs="unbounded"/>
155 </sequence>
156 </complexType>
157
158 <complexType name="role">
159 <attribute name="key" type="string"/>
160 <attribute name="text" type="string"/>
161 <attribute name="requisite" type="string"/>
162 <attribute name="type" type="string"/>
163 </complexType>
164
165 <simpleType name="role_requisite">
166 <restriction base="string">
167 <enumeration value="required"/>
168 <enumeration value="optional"/>
169 </restriction>
170 </simpleType>
171
172</schema>
Note: See TracBrowser for help on using the repository browser.