Changed the osversion to only accept nonNegativeInteger (in the schema).
[pandora-libraries.git] / docs / PXML_schema.xsd
1 <?xml version="1.0" encoding="utf-8"?>
2 <xs:schema targetNamespace="http://openpandora.org/namespaces/PXML" xmlns="http://openpandora.org/namespaces/PXML" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
3         
4         
5         <!-- declare some simpleTypes for later usage -->
6         
7         <!-- Specify params allows with the 'x11' entry in exec -->
8         <xs:simpleType name="x11Param">
9                 <xs:restriction base="xs:string">
10                         <xs:enumeration value="req" />
11                         <xs:enumeration value="stop" />
12                         <xs:enumeration value="ignore" />
13                 </xs:restriction>
14         </xs:simpleType>
15         
16         <!-- Specify the valid documentation formats in the <info> block -->
17         <xs:simpleType name="docType">
18                 <xs:restriction base="xs:string">
19                         <xs:enumeration value="text/html" />
20                         <xs:enumeration value="text/plain" />
21                 </xs:restriction>
22         </xs:simpleType>
23         
24         <!-- Make sure that version numbers only consist of letters, numbers and + as well as - -->
25         <xs:simpleType name="versionNumber">
26                 <xs:restriction base="xs:string">
27                         <xs:minLength value="1"/>
28                         <xs:pattern value="[a-zA-Z0-9+-]*" />
29                 </xs:restriction>
30         </xs:simpleType>
31         
32         <!-- Specify what is valid as release type -->
33         <xs:simpleType name="releaseType">
34                 <xs:restriction base="xs:string">
35                         <xs:enumeration value="alpha" />
36                         <xs:enumeration value="beta" />
37                         <xs:enumeration value="release" />
38                 </xs:restriction>
39         </xs:simpleType>
40         
41         <!-- Specify what makes an email address "valid" -->
42         <xs:simpleType name="emailAddress">
43                 <xs:restriction base="xs:string">
44                         <xs:pattern value="[^@]+@[^\.]+\..+"/>
45                 </xs:restriction>
46         </xs:simpleType>
47         
48         <!-- some restrictions regarding file names that are eg not allowed/possible when using sd cards formated as fat32 -->
49         <xs:simpleType name="dumbPath">
50                 <xs:restriction base="xs:normalizedString">
51                         <xs:pattern value="[^?>:]+" />
52                 </xs:restriction>
53         </xs:simpleType>
54         <xs:simpleType name="dumbFolderName">
55                 <xs:restriction base="xs:normalizedString">
56                         <xs:pattern value="[^?>:/]+" />
57                 </xs:restriction>
58         </xs:simpleType>
59         
60         <!-- Specify lang codes -->
61         <xs:simpleType name="isoLangcode">
62                 <xs:restriction base="xs:string">
63                         <xs:minLength value="2"/>
64                         <xs:pattern value="[a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})*" />
65                 </xs:restriction>
66         </xs:simpleType>
67         <xs:simpleType name="isoLangcode_en_US">
68                 <xs:restriction base="xs:string">
69                         <xs:enumeration value="en_US" />
70                 </xs:restriction>
71         </xs:simpleType>
72         
73         <!-- Definition of all allowed categories following the FDO specs -->
74         <xs:simpleType name="fdoCategory">
75                 <xs:restriction base="xs:string">
76                         <xs:pattern value="AudioVideo|Audio|Video|Development|Education|Game|Graphics|Network|Office|Settings|System|Utility"/>
77                 </xs:restriction>
78         </xs:simpleType>
79         <!-- Definition of all allowed subcategories following the FDO specs (should be based upon the given main categories, but would significantly increase complexity of the schema) -->
80         <xs:simpleType name="fdoSubCategory">
81                 <xs:restriction base="xs:string">
82                         <xs:pattern value="Building|Debugger|IDE|GUIDesigner|Profiling|RevisionControl|Translation|Calendar|ContactManagement|Database|Dictionary|Chart|Email|Finance|FlowChart|PDA|ProjectManagement|Presentation|Spreadsheet|WordProcessor|2DGraphics|VectorGraphics|RasterGraphics|3DGraphics|Scanning|OCR|Photography|Publishing|Viewer|TextTools|DesktopSettings|HardwareSettings|Printing|PackageManager|Dialup|InstantMessaging|Chat|IRCClient|FileTransfer|HamRadio|News|P2P|RemoteAccess|Telephony|TelephonyTools|VideoConference|WebBrowser|WebDevelopment|Midi|Mixer|Sequencer|Tuner|TV|AudioVideoEditing|Player|Recorder|DiscBurning|ActionGame|AdventureGame|ArcadeGame|BoardGame|BlocksGame|CardGame|KidsGame|LogicGame|RolePlaying|Simulation|SportsGame|StrategyGame|Art|Construction|Music|Languages|Science|ArtificialIntelligence|Astronomy|Biology|Chemistry|ComputerScience|DataVisualization|Economy|Electricity|Geography|Geology|Geoscience|History|ImageProcessing|Literature|Math|NumericalAnalysis|MedicalSoftware|Physics|Robotics|Sports|ParallelComputing|Amusement|Archiving|Compression|Electronics|Emulator|Engineering|FileTools|FileManager|TerminalEmulator|Filesystem|Monitor|Security|Accessibility|Calculator|Clock|TextEditor|Documentation|Core|KDE|GNOME|GTK|Qt|Motif|Java|ConsoleOnly"/>
83                 </xs:restriction>
84         </xs:simpleType>
85         
86         <!-- Create some way to enforce entries to be nonempty -->
87         <xs:simpleType name="nonempty_token">
88                 <xs:restriction base="xs:token">
89                         <xs:minLength value="1"/>
90                 </xs:restriction>
91         </xs:simpleType>
92                 <xs:simpleType name="nonempty_string">
93                 <xs:restriction base="xs:string">
94                         <xs:minLength value="1"/>
95                 </xs:restriction>
96         </xs:simpleType>
97                 <xs:simpleType name="nonempty_normalizedString">
98                 <xs:restriction base="xs:string">
99                         <xs:minLength value="1"/>
100                 </xs:restriction>
101         </xs:simpleType>
102         
103         
104         
105         <!-- declare some complexTypes for later usage -->
106         
107         <!-- type used for file associations -->
108         <xs:complexType name="association_data">
109                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
110                 <xs:attribute name="filetype" use="required" type="nonempty_token" />
111                 <xs:attribute name="exec" use="required" type="nonempty_token" />
112         </xs:complexType>
113         
114         <!-- type used for author info -->
115         <xs:complexType name="author_data">
116                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
117                 <xs:attribute name="website" use="optional" type="xs:anyURI" />
118                 <xs:attribute name="email" use="optional" type="emailAddress" />
119         </xs:complexType>
120         
121         <!-- type used for version informations (full entry) -->
122         <xs:complexType name="app_version_info">
123                 <xs:attribute name="major" use="required" type="versionNumber" />
124                 <xs:attribute name="minor" use="required" type="versionNumber" />
125                 <xs:attribute name="release" use="required" type="versionNumber" />
126                 <xs:attribute name="build" use="required" type="versionNumber" />
127                 <xs:attribute name="type" use="optional" type="releaseType" />
128         </xs:complexType>
129         <!-- type used for OS version information (os version only) -->
130         <xs:complexType name="os_version_info">
131                 <xs:attribute name="major" use="required" type="xs:nonNegativeInteger" />
132                 <xs:attribute name="minor" use="required" type="xs:nonNegativeInteger" />
133                 <xs:attribute name="release" use="required" type="xs:nonNegativeInteger" />
134                 <xs:attribute name="build" use="required" type="xs:nonNegativeInteger" />
135         </xs:complexType>
136         
137         <!-- type used for exec entries -->
138         <xs:complexType name="exec_params">
139                 <xs:attribute name="command" use="required" type="nonempty_token" />
140                 <xs:attribute name="arguments" use="optional" type="nonempty_token" />
141                 <xs:attribute name="background" use="optional" type="xs:boolean" />
142                 <xs:attribute name="startdir" use="optional" type="dumbPath" />
143                 <xs:attribute name="standalone" use="optional" type="xs:boolean" />
144                 <xs:attribute name="x11" use="optional" type="x11Param" />
145         </xs:complexType>
146         
147         <!-- type used for tiles or descriptions, once in 'normal' version, once enforcing usage of en_US -->
148         <xs:complexType name="title_or_description">
149                 <xs:simpleContent>
150                         <xs:extension base="nonempty_string">
151                                 <xs:attribute name="lang" use="required" type="isoLangcode" />
152                         </xs:extension>
153                 </xs:simpleContent>
154         </xs:complexType>
155         <xs:complexType name="title_or_description_enUS">
156                 <xs:simpleContent>
157                         <xs:extension base="nonempty_string">
158                                 <xs:attribute name="lang" use="required" type="isoLangcode_en_US" />
159                         </xs:extension>
160                 </xs:simpleContent>
161         </xs:complexType>
162         
163         <!-- type used for referencing images -->
164         <xs:complexType name="image_entry">
165                 <xs:attribute name="src" use="required" type="dumbPath" />
166         </xs:complexType>
167         
168         <!-- type for referencing manuals/readme docs -->
169         <xs:complexType name="information_entry">
170                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
171                 <xs:attribute name="type" use="required" type="docType" />
172                 <xs:attribute name="src" use="required" type="dumbPath" />
173         </xs:complexType>
174         
175         <!-- type used for the license information -->
176         <xs:complexType name="license_info">
177                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
178                 <xs:attribute name="url" use="optional" type="xs:anyURI" />
179                 <xs:attribute name="sourcecodeurl" use="optional" type="xs:anyURI" />
180         </xs:complexType>
181         
182         
183         
184         <!-- Combine the symple and complex types into the "real" PXML specification -->
185         
186         <xs:element name="PXML">
187                 <xs:complexType>
188                         <xs:sequence>
189                                 <!-- specify the <package> tag with info about the complete package, information providable:
190                                         author
191                                         version
192                                         title(s)
193                                         description(s)
194                                         icon
195                                         -->
196                                 <xs:element name="package" minOccurs="1" maxOccurs="1">
197                                         <xs:complexType>
198                                                 <xs:all>
199                                                         <!--Author info-->
200                                                         <xs:element name="author" type="author_data" minOccurs="1" />
201                                                         <!--App version info-->
202                                                         <xs:element name="version" type="app_version_info" minOccurs="1" />
203                                                         <!--Title-->
204                                                         <xs:element name="titles" minOccurs="1">
205                                                                 <xs:complexType>
206                                                                         <xs:sequence>
207                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
208                                                                                 <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
209                                                                         </xs:sequence>
210                                                                 </xs:complexType>
211                                                         </xs:element>
212                                                         <!--Description-->
213                                                         <xs:element name="descriptions" minOccurs="0">
214                                                                 <xs:complexType>
215                                                                         <xs:sequence>
216                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="0" maxOccurs="1" />
217                                                                                 <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
218                                                                         </xs:sequence>
219                                                                 </xs:complexType>
220                                                         </xs:element>
221                                                         <!--Icon-->
222                                                         <xs:element name="icon" type="image_entry" minOccurs="0" />
223                                                 </xs:all>
224                                                 <!--Package ID-->
225                                                 <xs:attribute name="id" use="required" type="dumbFolderName" />
226                                         </xs:complexType>
227                                 </xs:element>
228                                 <!-- specify the <application> tag with info about a single program
229                                         executable call
230                                         author
231                                         version (of the application)
232                                         osversion (min OS version supported)
233                                         title(s) (allowing compatibility to <HF6, too!)
234                                         description(s) (allowing compatibility to <HF6, too!)
235                                         icon
236                                         license
237                                         preview pictures
238                                         info/manual/readme entry
239                                         categories
240                                         associations to file types
241                                         clockspeed
242                                         -->
243                                 <xs:element name="application" minOccurs="1" maxOccurs="unbounded">
244                                         <xs:complexType>
245                                                 <xs:all>
246                                                         <!--Execution params -->
247                                                         <xs:element name="exec" type="exec_params" minOccurs="1" />
248                                                         <!--Author info-->
249                                                         <xs:element name="author" type="author_data" minOccurs="1" />
250                                                         <!--App version info-->
251                                                         <xs:element name="version" type="app_version_info" minOccurs="1" />
252                                                         <!--OS Version info-->
253                                                         <xs:element name="osversion" type="os_version_info" minOccurs="0" />
254                                                         <!--Title-->
255                                                         <!-- via <titles> element, used for HF6+ -->
256                                                         <xs:element name="titles" minOccurs="1">
257                                                                 <xs:complexType>
258                                                                         <xs:sequence>
259                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
260                                                                                 <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
261                                                                         </xs:sequence>
262                                                                 </xs:complexType>
263                                                         </xs:element>
264                                                         <!--Title-->
265                                                         <!-- via <title> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
266                                                         <xs:element name="title" type="title_or_description_enUS" minOccurs="0" />
267                                                         <!--Description-->
268                                                         <!-- via <descriptions> element, used for HF6+ -->
269                                                         <xs:element name="descriptions" minOccurs="0">
270                                                                 <xs:complexType>
271                                                                         <xs:sequence>
272                                                                                 <xs:element name="description" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
273                                                                                 <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
274                                                                         </xs:sequence>
275                                                                 </xs:complexType>
276                                                         </xs:element>
277                                                         <!--Description-->
278                                                         <!-- via <description> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
279                                                         <xs:element name="description" type="title_or_description_enUS" minOccurs="0" />
280                                                         <!--Icon-->
281                                                         <xs:element name="icon" type="image_entry" minOccurs="0" />
282                                                         <!--License-->
283                                                         <xs:element name="licenses" minOccurs="1">
284                                                                 <xs:complexType>
285                                                                         <xs:sequence>
286                                                                                 <xs:element name="license" type="license_info" minOccurs="1" maxOccurs="unbounded" />
287                                                                         </xs:sequence>
288                                                                 </xs:complexType>
289                                                         </xs:element>
290                                                         <!--Preview pics-->
291                                                         <xs:element name="previewpics" minOccurs="0">
292                                                                 <xs:complexType>
293                                                                         <xs:sequence>
294                                                                                 <xs:element name="pic" type="image_entry" minOccurs="0" maxOccurs="unbounded" />
295                                                                         </xs:sequence>
296                                                                 </xs:complexType>
297                                                         </xs:element>
298                                                         <!--Info (aka manual or readme entry)-->
299                                                         <xs:element name="info" type="information_entry" minOccurs="0" />
300                                                         <!--Categories-->
301                                                         <xs:element name="categories" minOccurs="1">
302                                                                 <xs:complexType>
303                                                                         <xs:sequence>
304                                                                                 <xs:element name="category" minOccurs="1" maxOccurs="unbounded">
305                                                                                         <xs:complexType>
306                                                                                                 <xs:sequence>
307                                                                                                         <xs:element name="subcategory" minOccurs="0" maxOccurs="unbounded">
308                                                                                                                 <xs:complexType>
309                                                                                                                         <xs:attribute name="name" type="fdoSubCategory" />
310                                                                                                                 </xs:complexType>
311                                                                                                         </xs:element>
312                                                                                                 </xs:sequence>
313                                                                                                 <xs:attribute name="name" use="required" type="fdoCategory" />
314                                                                                         </xs:complexType>
315                                                                                 </xs:element>
316                                                                         </xs:sequence>
317                                                                 </xs:complexType>
318                                                         </xs:element>
319                                                         <!--Associations-->
320                                                         <xs:element name="associations" minOccurs="0">
321                                                                 <xs:complexType>
322                                                                         <xs:sequence>
323                                                                                 <xs:element name="association" type="association_data" maxOccurs="unbounded" />
324                                                                         </xs:sequence>
325                                                                 </xs:complexType>
326                                                         </xs:element>
327                                                         <!--Clockspeed-->
328                                                         <xs:element name="clockspeed" minOccurs="0">
329                                                                 <xs:complexType>
330                                                                         <xs:attribute name="frequency" use="required" type="xs:positiveInteger" />
331                                                                 </xs:complexType>
332                                                         </xs:element>
333                                                 </xs:all>
334                                                 <!--AppID-->
335                                                 <xs:attribute name="id" use="required" type="dumbFolderName" />
336                                                 <xs:attribute name="appdata" use="optional" type="dumbFolderName" />
337                                         </xs:complexType>
338                                 </xs:element>
339                         </xs:sequence>
340                 </xs:complexType>
341         </xs:element>
342 </xs:schema>