1 <?xml version="1.0" encoding="UTF-8"?>
2 <html xmlns="http://www.w3.org/1999/xhtml">
4 <title>The PXML file format</title>
6 The official current-most specification is: http://pandorawiki.org/PXML_specification
8 <style type="text/css">
9 body { background-color: white; }
12 font: normal 2em sans-serif;
13 counter-reset: section;
14 border-bottom: thin solid blue;
17 counter-increment: section;
18 content: counter(section) ". ";
19 font: normal 0.5em sans-serif;
25 font: normal 1.4em sans-serif;
26 counter-reset: subsection;
29 counter-increment: subsection;
30 content: counter(section) ". " counter(subsection) ". ";
31 font: normal 0.5em sans-serif;
37 font: normal 1.2em sans-serif;
38 counter-reset: element;
41 counter-increment: element;
42 content: counter(section) ". " counter(subsection) ". " counter(element) ". ";
43 font: normal 0.5em sans-serif;
48 color: rgb(0, 0, 128);
49 font: normal 1.1em sans-serif;
52 color: rgb(64, 64, 64);
53 font: normal 1em sans-serif;
56 color: rgb(32, 32, 32);
57 font: normal 1em sans-serif;
60 font: normal 1em monospace;
62 background-color: rgb(196, 196, 196);
63 border: thin solid #888;
68 outline: #444 solid thin;
70 brack:before { content: "("; } /* just for fun XD */
71 brack:after { content: ")"; }
72 imp { font-weight: bold; }
76 <h1>The PXML file format specification</h1>
81 Attention: at the present time, the PXML file format isn't set in stone, and is therefore subject to change.
82 There is no guarantee that the format or the schema are bug-free or will be changed at any time.
83 Please wait until this standard is finished before writing a PXML file.
86 This is the human-readable specification for the PXML file format.
87 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.
90 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.
91 It should have the name <q>PXML.xml</q> <brack>not case sensitive</brack>, and there should only be one such file.
92 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.
95 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.
96 Included with this specification should also be a <q>.xsd</q>-file, which is used by XML tools to validate PXML files.
97 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.
100 To write a PXML file, you also need to know the basics of writing a XML file.
101 It boils down to the following:
103 <li>If an element contains text or other elements, it needs a start-tag and an end-tag. This looks like this:
105 <exampleelement someattribute="something">something inside it</exampleeelement>
108 <li>If an element does <imp>not</imp> contain other elements or text, but only attributes, it looks like this:
110 <exampleelement2 someattribute="something" />
119 The PXML-file is split up into multiple so-called <imp>elements</imp>, each of which specify one property of the
121 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:
124 <h3>The PXML-tag</h3>
126 The PXML-tag serves as the container for all PXML elements. It is the first thing that should occur in your PXML file.
127 An example <q><PXML></q>-tag would look like this:
130 <PXML xmlns="http://openpandora.org/namespaces/PXML" id="uniqueID"><br/>
131 <!--All of the PXML elements should be put here--><br/>
135 As you can see, the PXML tag accepts a few <imp>attributes</imp>, namely the <q>id</q> and <q>xmlns</q> attributes.
138 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.
139 You <imp>must</imp> include the xmlns attribute, exactly as shown, in your PXML file, with the URL as specified.
140 Only then can it be guaranteed that the file will be read at all by launchers and menu apps.
143 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.
144 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.
145 If this id already is used in another PND file, those two PND files will conflict with each other, and unforseeable errors will occur.
146 Please put effort into generating an unique id for your PXML-file.
149 <h3>The title element</h3>
152 The <imp>title</imp> element specifies the text that is shown to the users of your PND file as the application title.
153 This element can be specified multiple times in multiple languages <brack>the language is indicated by the lang attribute</brack>.
156 At least one <q>title</q>-element is required, in the <q>en_US</q> <brack>American English</brack> language.
160 <title lang="en_US">Your application name</title><br/><br/>
161 <title lang="de_DE">Deinen Programmnamen</title>
164 <h3>The description element</h3>
167 The <imp>description</imp> element specifies the text that is shown to the users of your PND file as the application description.
168 This element can be specified multiple times in multiple languages <brack>the language is indicated by the lang attribute</brack>.
171 At least one <q>description</q>-element is required, in the <q>en_US</q> <brack>American English</brack> language.
175 <description lang="en_US">Your long description of this application, describing it's purpose and highlighting it's features.</description><br/><br/>
176 <description lang="de_DE">Deine etwas längere Programmbeschreibung, die den Sinn des Programmes und den wichtigsten Features beschreiben sollte.</description>
179 <h3>The exec element</h3>
182 The <imp>exec</imp> element should specify all the information needed to execute your application.<br/>
183 An exec element <imp>must</imp> be included in every PXML file.
184 It accepts the following attributes:
187 The <imp>command</imp> attribute specifies the path to the executable file.
188 This should be a relative path to a file within the PND package.
191 The <imp>startdir</imp> attribute specifies the starting directory <brack>Also known as the working directory</brack> that the application should start in.
192 This should be a relative path to a directory within the PND package, or to a well-known directory in the Pandora file system.
195 The <imp>standalone</imp> attribute specifies wether or not this application can run on its own, or if it needs parameters to run.<br/>
196 A value of <q>true</q> or <q>1</q> means that the application can be run without parameters.<br/>
197 A value of <q>false</q> or <q>0</q> means that the application must be run with parameters.
200 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/>
201 A value of <q>true</q> or <q>1</q> means that the application can run in the background.<br/>
202 A value of <q>false</q> or <q>0</q> means that the application must be run as the only application.
206 <exec background="true" startdir="/usr/share/icons/" standalone="true" command="./myprogram"/>
209 <h3>The icon element</h3>
212 The <imp>icon</imp> element should specify a nice icon for your program.<br/>
213 An icon element <imp>is optional</imp>.
214 It accepts the following attributes:
217 The <imp>src</imp> attribute specifies the path to the image file used as the icon.
221 <icon src="./images/icon.png"/>
224 <h3>The previewpics element</h3>
227 The <imp>previewpics</imp> element is an element that contains multiple other elements.<br/>
228 A previewpics element <imp>is optional</imp>.
231 It contains multiple <imp>pic</imp>-elements. Every pic-element represents one preview picture.
232 If the previewpics element is specified, it must contain at least one pic element.
235 The <imp>src</imp> attribute on a pic element specifies the path to the image file used as the preview picture.
239 <previewpics><br/>
240 <pic src="./preview/pic1.jpg"/><br/>
241 <pic src="./preview/pic2.jpg"/><br/>
245 <h3>The author element</h3>
248 The <imp>author</imp> element is an element that is used by the author to introduce him/herself.<br/>
249 An author element <imp>is optional</imp>. It accepts the following attributes:
252 The <imp>name</imp> attribute specifies the name of the author.
255 The <imp>website</imp> attribute specifies the website of the author.
258 The <imp>email</imp> attribute specifies the e-mail of the author.<br/>
259 <imp>This attribute is not yet supported.</imp>
263 <author name="Bjornhild Andersson" website="http://some.website.with.author.info"/>
266 <h3>The version element</h3>
269 The <imp>version</imp> element specifies the application version.<br/>
270 A version element <imp>is required</imp>. It accepts the following attributes:
273 The <imp>major</imp> attribute specifies the major version number. This number should be 0 or more.
276 The <imp>minor</imp> attribute specifies the minor version number. This number should be 0 or more.
279 The <imp>release</imp> attribute specifies the release number. This number should be 0 or more.
282 The <imp>build</imp> attribute specifies what build the application is at. This number should be 0 or more.
286 <version major="1" minor="1" release="1" build="2"/>
289 <h3>The osversion element</h3>
292 The <imp>osversion</imp> element specifies the application version.<br/>
293 An osversion element <imp>is optional</imp>. It accepts the same attributes as the version element.
296 <osversion major="1" minor="1" release="1" build="2"/>
299 <h3>The categories element</h3>
302 The <imp>categories</imp> element is an element that contains multiple other elements.<br/>
303 A categories element <imp>is required, and must contain at least one category</imp>.
306 It contains multiple <imp>category</imp>-elements. Every category-element represents one category that this app can be sorted into.
307 Valid categories are (among others):
322 The category-element takes one attribute: The <imp>name</imp>-attribute.
323 This attribute represents the category name, which preferrably should be one of the above.
326 A category-element can contain further child-elements: <imp>subcategory</imp>-elements.
327 These represent the subcategories of a category that the app will be sorted into.
330 The subcategory-element also takes a <imp>name</imp>-attribute; this attibute can contain any name for your subcategory.
334 <categories><br/>
335 <category name="Games"><br/>
336 <subcategory name="Strategy"/><br/>
337 <subcategory name="Turn-based"/><br/>
338 </category><br/>
339 <category name="Graphics"><br/>
340 <subcategory name="Image Editors"/><br/>
341 </category><br/>
342 </categories><br/>
345 <h3>The associations element</h3>
348 The <imp>associations</imp> element is an element that contains multiple other elements.<br/>
349 An associations element <imp>is optional, except if exec.standalone is false</imp>.
352 It contains multiple <imp>association</imp>-elements. Every association-element represents one file action association.
355 The <imp>name</imp> attribute on an association element specifies the user-friendly action name for the association.
358 The <imp>filetype</imp> attribute on an association element specifies what file types (in MIME format) that this association should apply to.
361 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.
362 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/>
363 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>
367 <associations><br/>
368 <association name="Open Bitmap Image" filetype="image/bmp" exec="-f %s --no-deinterlacing"/><br/>
369 <association name="Crash the computer with a stylesheet" filetype="text/css" exec="-f %s --crash-on-success"/><br/>
370 </associations>
373 <h3>The clockspeed element</h3>
376 The <imp>clockspeed</imp> element specifies what clockspeed this app should run at.<br/>
377 A clockspeed element <imp>is optional</imp>. It accepts the following attributes:
380 The <imp>frequency</imp> attribute specifies the wanted frequency, in megahertz <brack>mHz</brack>.
384 <clockspeed frequency="600"/>
388 <h2>Example file</h2>
390 <?xml version="1.0" encoding="UTF-8"?><br/>
391 <PXML id="youruniqueID" xmlns="http://openpandora.org/namespaces/PXML"><br/>
392 <title lang="en_US">Program Title</title><br/>
393 <title lang="de_DE">German Program Title</title><br/>
395 <exec background="true" startdir="/usr/share/icons/" standalone="true" command="./program"/><br/>
397 <icon src="./program.png"/><br/>
399 <description lang="en_US">This is the English Description of the file.</description><br/>
400 <description lang="de_DE">This would be the German description.</description><br/>
402 <previewpics><br/>
403 <pic src="./preview/pic1.jpg"/><br/>
404 <pic src="./preview/pic2.jpg"/><br/>
405 </previewpics><br/>
407 <author name="Some Dudeson" website="http://a.bc.de"/><br/>
409 <version major="1" minor="1" release="1" build="2"/><br/>
410 <osversion major="1" minor="0" release="0" build="0"/><br/>
412 <categories><br/>
413 <category name="Main category"><br/>
414 <subcategory name="Subcategory 1"/><br/>
415 <subcategory name="Subcategory 2"/><br/>
416 </category><br/>
417 <category name="Alternative category"><br/>
418 <subcategory name="Alternative Subcategory 1"/><br/>
419 </category><br/>
420 </categories><br/>
422 <associations><br/>
423 <association name="View Word File" filetype="application/msword" exec="-f %s -t doc"/><br/>
424 </associations><br/>
426 <clockspeed frequency="600"/><!--Frequency in Hz--><br/>
432 <p>To validate a PXML file, you need a XSD (XML schema) validator, and you have to know how to use it.</p>
433 <p>You will also need to put the XML schema for the PXML format in the same folder as your PXML file.</p>
435 When you have done that, and know how to use it, you need to change a few things in your PXML file.
436 In your PXML tag, change the contents from this:
439 <PXML id="..." xmlns="http://openpandora.org/namespaces/PXML">...
443 <PXML id="..." xmlns="http://openpandora.org/namespaces/PXML" <imp>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd"</imp>>...
446 Now the PXML file can be validated.