New schema as discussed on the firmware-dev ml, cf this thread:
[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 as well as os version) -->
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         <xs:complexType name="os_version_info">
130                 <xs:attribute name="major" use="required" type="versionNumber" />
131                 <xs:attribute name="minor" use="required" type="versionNumber" />
132                 <xs:attribute name="release" use="required" type="versionNumber" />
133                 <xs:attribute name="build" use="required" type="versionNumber" />
134         </xs:complexType>
135         
136         <!-- type used for exec entries -->
137         <xs:complexType name="exec_params">
138                 <xs:attribute name="command" use="required" type="nonempty_token" />
139                 <xs:attribute name="arguments" use="optional" type="nonempty_token" />
140                 <xs:attribute name="background" use="optional" type="xs:boolean" />
141                 <xs:attribute name="startdir" use="optional" type="dumbPath" />
142                 <xs:attribute name="standalone" use="optional" type="xs:boolean" />
143                 <xs:attribute name="x11" use="optional" type="x11Param" />
144         </xs:complexType>
145         
146         <!-- type used for tiles or descriptions, once in 'normal' version, once enforcing usage of en_US -->
147         <xs:complexType name="title_or_description">
148                 <xs:simpleContent>
149                         <xs:extension base="nonempty_string">
150                                 <xs:attribute name="lang" use="required" type="isoLangcode" />
151                         </xs:extension>
152                 </xs:simpleContent>
153         </xs:complexType>
154         <xs:complexType name="title_or_description_enUS">
155                 <xs:simpleContent>
156                         <xs:extension base="nonempty_string">
157                                 <xs:attribute name="lang" use="required" type="isoLangcode_en_US" />
158                         </xs:extension>
159                 </xs:simpleContent>
160         </xs:complexType>
161         
162         <!-- type used for referencing images -->
163         <xs:complexType name="image_entry">
164                 <xs:attribute name="src" use="required" type="dumbPath" />
165         </xs:complexType>
166         
167         <!-- type for referencing manuals/readme docs -->
168         <xs:complexType name="information_entry">
169                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
170                 <xs:attribute name="type" use="required" type="docType" />
171                 <xs:attribute name="src" use="required" type="dumbPath" />
172         </xs:complexType>
173         
174         <!-- type used for the license information -->
175         <xs:complexType name="license_info">
176                 <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
177                 <xs:attribute name="url" use="optional" type="xs:anyURI" />
178                 <xs:attribute name="sourcecodeurl" use="optional" type="xs:anyURI" />
179         </xs:complexType>
180         
181         
182         
183         <!-- Combine the symple and complex types into the "real" PXML specification -->
184         
185         <xs:element name="PXML">
186                 <xs:complexType>
187                         <xs:sequence>
188                                 <!-- specify the <package> tag with info about the complete package, information providable:
189                                         author
190                                         version
191                                         title(s)
192                                         description(s)
193                                         icon
194                                         -->
195                                 <xs:element name="package" minOccurs="1" maxOccurs="1">
196                                         <xs:complexType>
197                                                 <xs:all>
198                                                         <!--Author info-->
199                                                         <xs:element name="author" type="author_data" minOccurs="1" />
200                                                         <!--App version info-->
201                                                         <xs:element name="version" type="app_version_info" minOccurs="1" />
202                                                         <!--Title-->
203                                                         <xs:element name="titles" minOccurs="1">
204                                                                 <xs:complexType>
205                                                                         <xs:sequence>
206                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
207                                                                                 <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
208                                                                         </xs:sequence>
209                                                                 </xs:complexType>
210                                                         </xs:element>
211                                                         <!--Description-->
212                                                         <xs:element name="descriptions" minOccurs="0">
213                                                                 <xs:complexType>
214                                                                         <xs:sequence>
215                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="0" maxOccurs="1" />
216                                                                                 <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
217                                                                         </xs:sequence>
218                                                                 </xs:complexType>
219                                                         </xs:element>
220                                                         <!--Icon-->
221                                                         <xs:element name="icon" type="image_entry" minOccurs="0" />
222                                                 </xs:all>
223                                                 <!--Package ID-->
224                                                 <xs:attribute name="id" use="required" type="dumbFolderName" />
225                                         </xs:complexType>
226                                 </xs:element>
227                                 <!-- specify the <application> tag with info about a single program
228                                         executable call
229                                         author
230                                         version (of the application)
231                                         osversion (min OS version supported)
232                                         title(s) (allowing compatibility to <HF6, too!)
233                                         description(s) (allowing compatibility to <HF6, too!)
234                                         icon
235                                         license
236                                         preview pictures
237                                         info/manual/readme entry
238                                         categories
239                                         associations to file types
240                                         clockspeed
241                                         -->
242                                 <xs:element name="application" minOccurs="1" maxOccurs="unbounded">
243                                         <xs:complexType>
244                                                 <xs:all>
245                                                         <!--Execution params -->
246                                                         <xs:element name="exec" type="exec_params" minOccurs="1" />
247                                                         <!--Author info-->
248                                                         <xs:element name="author" type="author_data" minOccurs="1" />
249                                                         <!--App version info-->
250                                                         <xs:element name="version" type="app_version_info" minOccurs="1" />
251                                                         <!--OS Version info-->
252                                                         <xs:element name="osversion" type="os_version_info" minOccurs="0" />
253                                                         <!--Title-->
254                                                         <!-- via <titles> element, used for HF6+ -->
255                                                         <xs:element name="titles" minOccurs="1">
256                                                                 <xs:complexType>
257                                                                         <xs:sequence>
258                                                                                 <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
259                                                                                 <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
260                                                                         </xs:sequence>
261                                                                 </xs:complexType>
262                                                         </xs:element>
263                                                         <!--Title-->
264                                                         <!-- via <title> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
265                                                         <xs:element name="title" type="title_or_description_enUS" minOccurs="0" />
266                                                         <!--Description-->
267                                                         <!-- via <descriptions> element, used for HF6+ -->
268                                                         <xs:element name="descriptions" minOccurs="0">
269                                                                 <xs:complexType>
270                                                                         <xs:sequence>
271                                                                                 <xs:element name="description" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
272                                                                                 <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
273                                                                         </xs:sequence>
274                                                                 </xs:complexType>
275                                                         </xs:element>
276                                                         <!--Description-->
277                                                         <!-- via <description> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
278                                                         <xs:element name="description" type="title_or_description_enUS" minOccurs="0" />
279                                                         <!--Icon-->
280                                                         <xs:element name="icon" type="image_entry" minOccurs="0" />
281                                                         <!--License-->
282                                                         <xs:element name="licenses" minOccurs="1">
283                                                                 <xs:complexType>
284                                                                         <xs:sequence>
285                                                                                 <xs:element name="license" type="license_info" minOccurs="1" maxOccurs="unbounded" />
286                                                                         </xs:sequence>
287                                                                 </xs:complexType>
288                                                         </xs:element>
289                                                         <!--Preview pics-->
290                                                         <xs:element name="previewpics" minOccurs="0">
291                                                                 <xs:complexType>
292                                                                         <xs:sequence>
293                                                                                 <xs:element name="pic" type="image_entry" minOccurs="0" maxOccurs="unbounded" />
294                                                                         </xs:sequence>
295                                                                 </xs:complexType>
296                                                         </xs:element>
297                                                         <!--Info (aka manual or readme entry)-->
298                                                         <xs:element name="info" type="information_entry" minOccurs="0" />
299                                                         <!--Categories-->
300                                                         <xs:element name="categories" minOccurs="1">
301                                                                 <xs:complexType>
302                                                                         <xs:sequence>
303                                                                                 <xs:element name="category" minOccurs="1" maxOccurs="unbounded">
304                                                                                         <xs:complexType>
305                                                                                                 <xs:sequence>
306                                                                                                         <xs:element name="subcategory" minOccurs="0" maxOccurs="unbounded">
307                                                                                                                 <xs:complexType>
308                                                                                                                         <xs:attribute name="name" type="fdoSubCategory" />
309                                                                                                                 </xs:complexType>
310                                                                                                         </xs:element>
311                                                                                                 </xs:sequence>
312                                                                                                 <xs:attribute name="name" use="required" type="fdoCategory" />
313                                                                                         </xs:complexType>
314                                                                                 </xs:element>
315                                                                         </xs:sequence>
316                                                                 </xs:complexType>
317                                                         </xs:element>
318                                                         <!--Associations-->
319                                                         <xs:element name="associations" minOccurs="0">
320                                                                 <xs:complexType>
321                                                                         <xs:sequence>
322                                                                                 <xs:element name="association" type="association_data" maxOccurs="unbounded" />
323                                                                         </xs:sequence>
324                                                                 </xs:complexType>
325                                                         </xs:element>
326                                                         <!--Clockspeed-->
327                                                         <xs:element name="clockspeed" minOccurs="0">
328                                                                 <xs:complexType>
329                                                                         <xs:attribute name="frequency" use="required" type="xs:positiveInteger" />
330                                                                 </xs:complexType>
331                                                         </xs:element>
332                                                 </xs:all>
333                                                 <!--AppID-->
334                                                 <xs:attribute name="id" use="required" type="dumbFolderName" />
335                                                 <xs:attribute name="appdata" use="optional" type="dumbFolderName" />
336                                         </xs:complexType>
337                                 </xs:element>
338                         </xs:sequence>
339                 </xs:complexType>
340         </xs:element>
341 </xs:schema>