-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopen-mensa-v2.xsd
145 lines (138 loc) · 6.63 KB
/
open-mensa-v2.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://openmensa.org/open-mensa-v2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://openmensa.org/open-mensa-v2" elementFormDefault="qualified">
<xs:element name="openmensa" type="openmensaType"></xs:element>
<xs:complexType name="openmensaType">
<xs:annotation>
<xs:documentation>This is the required OpenMense root element always accompanied by a version attribute that explicitly tells the feed's version to the parser.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="canteen" type="canteenType">
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:float" use="required">
<xs:annotation>
<xs:documentation>The version should be equal to 2.0.</xs:documentation>
</xs:annotation></xs:attribute>
</xs:complexType>
<xs:complexType name="canteenType">
<xs:annotation>
<xs:documentation>This stands for a single canteen.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="day" type="dayType" maxOccurs="unbounded"
minOccurs="0">
<xs:annotation>
<xs:documentation>All meals of all categories are grouped by day. There may be no day elements at all - that's ok because for some days there are no meals.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dayType">
<xs:choice>
<xs:element name="category" type="categoryType"
maxOccurs="unbounded" minOccurs="1">
<xs:annotation>
<xs:documentation>Every meal must belong to a category so there should be at least one category since a day without any meals may be omitted completely else.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="closed">
<xs:annotation>
<xs:documentation>Indicates that for the given day a canteen has closed (to distinguish from the case where there is - for some reason - no data). Should be used on weekends or explicit closing times on holidays.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="0"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:choice>
<xs:attribute name="date" use="required">
<xs:annotation>
<xs:documentation>This field specifies the date of the day as "YYYY-MM-DD.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation></xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern
value="[0-9]{4,4}-[0-9]{2,2}-[0-9]{2,2}">
</xs:pattern>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="categoryType">
<xs:sequence>
<xs:element name="meal" type="mealType" maxOccurs="unbounded" minOccurs="1">
<xs:annotation>
<xs:documentation>Each category must contain at least one meal because else the category is useless.</xs:documentation>
</xs:annotation></xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:annotation>
<xs:documentation>The name of the category, e.g. "Essen 1" or "Ausgabe A".</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
<xs:maxLength value="250"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="mealType">
<xs:sequence>
<xs:element name="name">
<xs:annotation>
<xs:documentation>The name of the meal, e.g. "Rinderhacksteak mit Kartoffeln". Shouldn't be more than a couple of words or a sentence in maximum. Additional text may go into several notes.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
<xs:maxLength value="250"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="note" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>A note often resembles a properties of the associated meal like the ingredients used or some important annotations.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
<xs:maxLength value="250"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="price" maxOccurs="unbounded" minOccurs="0" type="priceType">
<xs:annotation>
<xs:documentation>This field contains a price in euro for a given role (because different prices may apply different groups of people). There mustn't be two price elements with the same role for a meal!</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="priceType">
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute name="role" use="required">
<xs:annotation>
<xs:documentation>A price's role defines for which group of persons the price is valid:
- pupils (some canteens do that)
- students
- employees (of your organization) or
- others (people that do not belong to your organization or to any other group listed here).</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="pupil"></xs:enumeration>
<xs:enumeration value="student"></xs:enumeration>
<xs:enumeration value="employee"></xs:enumeration>
<xs:enumeration value="other"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>