1 <?xml version="1.0" encoding="UTF-8"?>
2 <html xmlns="http://www.w3.org/1999/xhtml">
4 <title>The PXML file format</title>
5 <style type="text/css">
6 body { background-color: white; }
9 font: normal 2em sans-serif;
10 counter-reset: section;
11 border-bottom: thin solid blue;
14 counter-increment: section;
15 content: counter(section) ". ";
16 font: normal 0.5em sans-serif;
22 font: normal 1.4em sans-serif;
23 counter-reset: subsection;
26 counter-increment: subsection;
27 content: counter(section) ". " counter(subsection) ". ";
28 font: normal 0.5em sans-serif;
34 font: normal 1.2em sans-serif;
35 counter-reset: element;
38 counter-increment: element;
39 content: counter(section) ". " counter(subsection) ". " counter(element) ". ";
40 font: normal 0.5em sans-serif;
45 color: rgb(0, 0, 128);
46 font: normal 1.1em sans-serif;
49 color: rgb(64, 64, 64);
50 font: normal 1em sans-serif;
53 color: rgb(32, 32, 32);
54 font: normal 1em sans-serif;
57 font: normal 1em monospace;
59 background-color: rgb(196, 196, 196);
60 border: thin solid #888;
65 outline: #444 solid thin;
67 brack:before { content: "("; } /* just for fun XD */
68 brack:after { content: ")"; }
69 imp { font-weight: bold; }
73 <h1>The PXML file format specification</h1>
78 Attention: at the present time, the PXML file format isn't set in stone, and is therefore subject to change.
79 There is no guarantee that the format or the schema are bug-free or will be changed at any time.
80 Please wait until this standard is finished before writing a PXML file.
83 This is the human-readable specification for the PXML file format.
84 The PXML file format is used in <imp>your</imp> applications for the <a href="http://openpandora.org">OpenPandora®</a> <brack>that you package in <q>.pnd</q>-files or distribute otherwise</brack>, to make it possible for menus and launchers to use your applications and their properties.
87 A PXML file should be appended to your <q>.pnd</q>-file, using the tools provided for that purpose, or put in a directory that you want to serve as a redistributable package, to make it possible for launchers and menus to find it.
88 It should have the name <q>PXML.xml</q> <brack>not case sensitive</brack>, and there should only be one such file.
89 The contents of the PXML file should also comply to this specification <imp>without exception</imp>, to guarantee that everyone will be able to read it.
92 The PXML format is XML-based and fully XML-compliant, which means that it can be read and written by any XML reader or writer.
93 Included with this specification should also be a <q>.xsd</q>-file, which is used by XML tools to validate PXML files.
94 A <q>.xsd</q>-file is also known as a XML schema, and can be called the <q>computer-readable</q> version of this document. It is very good practice to validate your PXML-files with that schema before publishing them.
97 To write a PXML file, you also need to know the basics of writing a XML file.
98 It boils down to the following:
100 <li>If an element contains text or other elements, it needs a start-tag and an end-tag. This looks like this:
102 <exampleelement someattribute="something">something inside it</exampleeelement>
105 <li>If an element does <imp>not</imp> contain other elements or text, but only attributes, it looks like this:
107 <exampleelement2 someattribute="something" />
116 The PXML-file is split up into multiple so-called <imp>elements</imp>, each of which specify one property of the
118 All of these elements are surrounded with a <imp><q><PXML></q>-tag</imp>, which tells the readers of the file that the data within that tag belongs to a PXML file. The tag and elements should be defined as follows:
121 <h3>The PXML-tag</h3>
123 The PXML-tag serves as the container for all PXML elements. It is the first thing that should occur in your PXML file.
124 An example <q><PXML></q>-tag would look like this:
127 <PXML xmlns="http://openpandora.org/namespaces/PXML" id="uniqueID"><br/>
128 <!--All of the PXML elements should be put here--><br/>
132 As you can see, the PXML tag accepts a few <imp>attributes</imp>, namely the <q>id</q> and <q>xmlns</q> attributes.
135 The <imp><q>xmlns</q></imp> attribute is required by the XML standard, and guarantees that this file will be identified as a PXML file.
136 You <imp>must</imp> include the xmlns attribute, exactly as shown, in your PXML file, with the URL as specified.
137 Only then can it be guaranteed that the file will be read at all by launchers and menu apps.
140 The <imp><q>id</q></imp> attribute specifies an identifier for your PND package, and should be something globally unique so that no two PND packages have the same id.
141 This can be achieved by appending some random number to your application name, and to use that as your id; or to simply generate a completely random, very long id.
142 If this id already is used in another PND file, those two PND files will conflict with each other, and unforseeable errors will occur.
143 Please put effort into generating an unique id for your PXML-file.
146 <h3>The title element</h3>
149 The <imp>title</imp> element specifies the text that is shown to the users of your PND file as the application title.
150 This element can be specified multiple times in multiple languages <brack>the language is indicated by the lang attribute</brack>.
153 At least one <q>title</q>-element is required, in the <q>en_US</q> <brack>American English</brack> language.
157 <title lang="en_US">Your application name</title><br/><br/>
158 <title lang="de_DE">Deinen Programmnamen</title>
161 <h3>The description element</h3>
164 The <imp>description</imp> element specifies the text that is shown to the users of your PND file as the application description.
165 This element can be specified multiple times in multiple languages <brack>the language is indicated by the lang attribute</brack>.
168 At least one <q>description</q>-element is required, in the <q>en_US</q> <brack>American English</brack> language.
172 <description lang="en_US">Your long description of this application, describing it's purpose and highlighting it's features.</description><br/><br/>
173 <description lang="de_DE">Deine etwas längere Programmbeschreibung, die den Sinn des Programmes und den wichtigsten Features beschreiben sollte.</description>
176 <h3>The exec element</h3>
179 The <imp>exec</imp> element should specify all the information needed to execute your application.<br/>
180 An exec element <imp>must</imp> be included in every PXML file.
181 It accepts the following attributes:
184 The <imp>command</imp> attribute specifies the path to the executable file.
185 This should be a relative path to a file within the PND package.
188 The <imp>startdir</imp> attribute specifies the starting directory <brack>Also known as the working directory</brack> that the application should start in.
189 This should be a relative path to a directory within the PND package, or to a well-known directory in the Pandora file system.
192 The <imp>standalone</imp> attribute specifies wether or not this application can run on its own, or if it needs parameters to run.<br/>
193 A value of <q>true</q> or <q>1</q> means that the application can be run without parameters.<br/>
194 A value of <q>false</q> or <q>0</q> means that the application must be run with parameters.
197 The <imp>background</imp> attribute specifies wether or not this application should run in the background, and it should be possible to switch to other apps while it is running, or if it is the only application that should be running.<br/>
198 A value of <q>true</q> or <q>1</q> means that the application can run in the background.<br/>
199 A value of <q>false</q> or <q>0</q> means that the application must be run as the only application.
203 <exec background="true" startdir="/usr/share/icons/" standalone="true" command="./myprogram"/>
206 <h3>The icon element</h3>
209 The <imp>icon</imp> element should specify a nice icon for your program.<br/>
210 An icon element <imp>is optional</imp>.
211 It accepts the following attributes:
214 The <imp>src</imp> attribute specifies the path to the image file used as the icon.
218 <icon src="./images/icon.png"/>
221 <h3>The previewpics element</h3>
224 The <imp>previewpics</imp> element is an element that contains multiple other elements.<br/>
225 A previewpics element <imp>is optional</imp>.
228 It contains multiple <imp>pic</imp>-elements. Every pic-element represents one preview picture.
229 If the previewpics element is specified, it must contain at least one pic element.
232 The <imp>src</imp> attribute on a pic element specifies the path to the image file used as the preview picture.
236 <previewpics><br/>
237 <pic src="./preview/pic1.jpg"/><br/>
238 <pic src="./preview/pic2.jpg"/><br/>
242 <h3>The author element</h3>
245 The <imp>author</imp> element is an element that is used by the author to introduce him/herself.<br/>
246 An author element <imp>is optional</imp>. It accepts the following attributes:
249 The <imp>name</imp> attribute specifies the name of the author.
252 The <imp>website</imp> attribute specifies the website of the author.
255 The <imp>email</imp> attribute specifies the e-mail of the author.<br/>
256 <imp>This attribute is not yet supported.</imp>
260 <author name="Bjornhild Andersson" website="http://some.website.with.author.info"/>
263 <h3>The version element</h3>
266 The <imp>version</imp> element specifies the application version.<br/>
267 A version element <imp>is required</imp>. It accepts the following attributes:
270 The <imp>major</imp> attribute specifies the major version number. This number should be 0 or more.
273 The <imp>minor</imp> attribute specifies the minor version number. This number should be 0 or more.
276 The <imp>release</imp> attribute specifies the release number. This number should be 0 or more.
279 The <imp>build</imp> attribute specifies what build the application is at. This number should be 0 or more.
283 <version major="1" minor="1" release="1" build="2"/>
286 <h3>The osversion element</h3>
289 The <imp>osversion</imp> element specifies the application version.<br/>
290 An osversion element <imp>is optional</imp>. It accepts the same attributes as the version element.
293 <osversion major="1" minor="1" release="1" build="2"/>
296 <h3>The categories element</h3>
299 The <imp>categories</imp> element is an element that contains multiple other elements.<br/>
300 A categories element <imp>is required, and must contain at least one category</imp>.
303 It contains multiple <imp>category</imp>-elements. Every category-element represents one category that this app can be sorted into.
304 Valid categories are (among others):
319 The category-element takes one attribute: The <imp>name</imp>-attribute.
320 This attribute represents the category name, which preferrably should be one of the above.
323 A category-element can contain further child-elements: <imp>subcategory</imp>-elements.
324 These represent the subcategories of a category that the app will be sorted into.
327 The subcategory-element also takes a <imp>name</imp>-attribute; this attibute can contain any name for your subcategory.
331 <categories><br/>
332 <category name="Games"><br/>
333 <subcategory name="Strategy"/><br/>
334 <subcategory name="Turn-based"/><br/>
335 </category><br/>
336 <category name="Graphics"><br/>
337 <subcategory name="Image Editors"/><br/>
338 </category><br/>
339 </categories><br/>
342 <h3>The associations element</h3>
345 The <imp>associations</imp> element is an element that contains multiple other elements.<br/>
346 An associations element <imp>is optional, except if exec.standalone is false</imp>.
349 It contains multiple <imp>association</imp>-elements. Every association-element represents one file action association.
352 The <imp>name</imp> attribute on an association element specifies the user-friendly action name for the association.
355 The <imp>filetype</imp> attribute on an association element specifies what file types (in MIME format) that this association should apply to.
358 The <imp>exec</imp> attribute on an association element specifies the command-line arguments that should be given to the program, when this action is performed.
359 The exec can contain a <q>%s</q>, which indicates where the file name of the file, that the action is performed on, should be inserted.<br/>
360 For example, if the exec-line is <q>--file %s --type lol</q>, and you have a file "lol.bmp" that the action is performed on, the exec-line is transformed into <q>--file "lol.bmp" --type lol</q>
364 <associations><br/>
365 <association name="Open Bitmap Image" filetype="image/bmp" exec="-f %s --no-deinterlacing"/><br/>
366 <association name="Crash the computer with a stylesheet" filetype="text/css" exec="-f %s --crash-on-success"/><br/>
367 </associations>
370 <h3>The clockspeed element</h3>
373 The <imp>clockspeed</imp> element specifies what clockspeed this app should run at.<br/>
374 A clockspeed element <imp>is optional</imp>. It accepts the following attributes:
377 The <imp>frequency</imp> attribute specifies the wanted frequency, in megahertz <brack>mHz</brack>.
381 <clockspeed frequency="600"/>
385 <h2>Example file</h2>
387 <?xml version="1.0" encoding="UTF-8"?><br/>
388 <PXML id="youruniqueID" xmlns="http://openpandora.org/namespaces/PXML"><br/>
389 <title lang="en_US">Program Title</title><br/>
390 <title lang="de_DE">German Program Title</title><br/>
392 <exec background="true" startdir="/usr/share/icons/" standalone="true" command="./program"/><br/>
394 <icon src="./program.png"/><br/>
396 <description lang="en_US">This is the English Description of the file.</description><br/>
397 <description lang="de_DE">This would be the German description.</description><br/>
399 <previewpics><br/>
400 <pic src="./preview/pic1.jpg"/><br/>
401 <pic src="./preview/pic2.jpg"/><br/>
402 </previewpics><br/>
404 <author name="Some Dudeson" website="http://a.bc.de"/><br/>
406 <version major="1" minor="1" release="1" build="2"/><br/>
407 <osversion major="1" minor="0" release="0" build="0"/><br/>
409 <categories><br/>
410 <category name="Main category"><br/>
411 <subcategory name="Subcategory 1"/><br/>
412 <subcategory name="Subcategory 2"/><br/>
413 </category><br/>
414 <category name="Alternative category"><br/>
415 <subcategory name="Alternative Subcategory 1"/><br/>
416 </category><br/>
417 </categories><br/>
419 <associations><br/>
420 <association name="View Word File" filetype="application/msword" exec="-f %s -t doc"/><br/>
421 </associations><br/>
423 <clockspeed frequency="600"/><!--Frequency in Hz--><br/>
429 <p>To validate a PXML file, you need a XSD (XML schema) validator, and you have to know how to use it.</p>
430 <p>You will also need to put the XML schema for the PXML format in the same folder as your PXML file.</p>
432 When you have done that, and know how to use it, you need to change a few things in your PXML file.
433 In your PXML tag, change the contents from this:
436 <PXML id="..." xmlns="http://openpandora.org/namespaces/PXML">...
440 <PXML id="..." xmlns="http://openpandora.org/namespaces/PXML" <imp>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd"</imp>>...
443 Now the PXML file can be validated.