1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/mappaint-style-1.0" |
---|
3 | xmlns:tns="http://josm.openstreetmap.de/mappaint-style-1.0" elementFormDefault="qualified"> |
---|
4 | |
---|
5 | <!-- |
---|
6 | Localized attributes (for example de.description are not supported by |
---|
7 | xsd, so root element needs <anyAttribute/> |
---|
8 | --> |
---|
9 | |
---|
10 | <element name="rules" type="tns:root"/> |
---|
11 | |
---|
12 | <complexType name="root"> |
---|
13 | <sequence> |
---|
14 | <choice minOccurs="0" maxOccurs="unbounded"> |
---|
15 | <element name="rule" type="tns:rule" /> |
---|
16 | </choice> |
---|
17 | </sequence> |
---|
18 | <attribute name="name" type="string" /> |
---|
19 | <attribute name="author" type="string" /> |
---|
20 | <attribute name="version" type="string" /> |
---|
21 | <attribute name="shortdescription" type="string" /> |
---|
22 | <attribute name="description" type="string" /> |
---|
23 | <attribute name="link" type="string"/> |
---|
24 | |
---|
25 | <anyAttribute processContents="skip"/> |
---|
26 | </complexType> |
---|
27 | |
---|
28 | <!-- TODO: ensure that at least one of results exists, but only one of each element, except for linemod which may have more, |
---|
29 | scale is totally optional, but each of the two may come only once --> |
---|
30 | <complexType name="rule"> |
---|
31 | <sequence> |
---|
32 | <element name="condition" type="tns:condition" minOccurs="1" maxOccurs="unbounded" /> |
---|
33 | <choice minOccurs="1" maxOccurs="unbounded" > |
---|
34 | <group ref="tns:results" /> |
---|
35 | <group ref="tns:scale" /> |
---|
36 | </choice> |
---|
37 | </sequence> |
---|
38 | </complexType> |
---|
39 | |
---|
40 | <group name="results"> |
---|
41 | <choice> |
---|
42 | <element name="icon" type="tns:icon" /> |
---|
43 | <element name="area" type="tns:area" /> |
---|
44 | <element name="line" type="tns:line" /> |
---|
45 | <element name="linemod" type="tns:linemod" maxOccurs="unbounded" /> |
---|
46 | </choice> |
---|
47 | </group> |
---|
48 | |
---|
49 | <group name="scale"> |
---|
50 | <choice> |
---|
51 | <element name="scale_min" type="integer" /> |
---|
52 | <element name="scale_max" type="integer" /> |
---|
53 | </choice> |
---|
54 | </group> |
---|
55 | |
---|
56 | <complexType name="condition"> |
---|
57 | <!-- TODO restrict to k, k+v or k+b, other attribute combinations are illegal --> |
---|
58 | <attribute name="k" type="string" use="required" /> |
---|
59 | <attribute name="v" type="string" /> |
---|
60 | <attribute name="b" type="tns:yesno" /> |
---|
61 | </complexType> |
---|
62 | |
---|
63 | <complexType name="icon"> |
---|
64 | <attribute name="src" type="string" use="required" /> |
---|
65 | <attribute name="annotate" type="boolean" /> |
---|
66 | <attribute name="priority" type="integer" /> |
---|
67 | </complexType> |
---|
68 | |
---|
69 | <complexType name="line"> |
---|
70 | <attribute name="width" type="integer" /> |
---|
71 | <attribute name="dashed" type="tns:dashed" /> |
---|
72 | <attribute name="realwidth" type="integer" /> |
---|
73 | <attribute name="colour" type="tns:color" /> |
---|
74 | <attribute name="dashedcolour" type="tns:color" /> |
---|
75 | <attribute name="priority" type="integer" /> |
---|
76 | </complexType> |
---|
77 | |
---|
78 | <complexType name="area"> |
---|
79 | <attribute name="colour" type="tns:color" /> |
---|
80 | <attribute name="closed" type="boolean" /> |
---|
81 | <attribute name="priority" type="integer" /> |
---|
82 | </complexType> |
---|
83 | |
---|
84 | <complexType name="linemod"> |
---|
85 | <attribute name="dashed" type="tns:dashed" /> |
---|
86 | <attribute name="realwidth" type="integer" /> |
---|
87 | <attribute name="colour" type="tns:color" /> |
---|
88 | <attribute name="dashedcolour" type="tns:color" /> |
---|
89 | <attribute name="mode" type="tns:modifier_mode" use="required" /> |
---|
90 | <attribute name="width" type="tns:width" /> |
---|
91 | </complexType> |
---|
92 | |
---|
93 | <simpleType name="yesno"> |
---|
94 | <restriction base="string"> |
---|
95 | <enumeration value="yes"/> |
---|
96 | <enumeration value="no"/> |
---|
97 | </restriction> |
---|
98 | </simpleType> |
---|
99 | |
---|
100 | <simpleType name="dashed"> |
---|
101 | <restriction base="string"> |
---|
102 | <pattern value="\d+(,\d+)*"/> |
---|
103 | <pattern value="(true|false)"/> |
---|
104 | </restriction> |
---|
105 | </simpleType> |
---|
106 | |
---|
107 | <simpleType name="modifier_mode"> |
---|
108 | <restriction base="string"> |
---|
109 | <enumeration value="under"/> |
---|
110 | <enumeration value="over"/> |
---|
111 | </restriction> |
---|
112 | </simpleType> |
---|
113 | |
---|
114 | <simpleType name="color"> |
---|
115 | <restriction base="string"> |
---|
116 | <pattern value="([a-z0-9_]+#)?[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?"/> |
---|
117 | <!-- name#color or color only, where color is 6 or 8 hex digits --> |
---|
118 | </restriction> |
---|
119 | </simpleType> |
---|
120 | |
---|
121 | <simpleType name="width"> |
---|
122 | <restriction base="string"> |
---|
123 | <pattern value="\d+"/> |
---|
124 | <pattern value="[+-]\d+"/> |
---|
125 | <pattern value="\d+%"/> |
---|
126 | </restriction> |
---|
127 | </simpleType> |
---|
128 | </schema> |
---|