New schema as discussed on the firmware-dev ml, cf this thread:
authorNils Kneuper <crazy-ivanovic@gmx.net>
Sat, 5 Mar 2011 19:35:09 +0000 (20:35 +0100)
committerNils Kneuper <crazy-ivanovic@gmx.net>
Sat, 5 Mar 2011 19:35:09 +0000 (20:35 +0100)
http://openpandora.org/pipermail/firmware-dev/2011-March/000056.html
Added updated examples

docs/PXML_schema.xsd
docs/PXML_schema_plaintext.txt
docs/examples/PXML-example.txt
docs/examples/PXML.xml
docs/examples/average-case_PXML.xml [new file with mode: 0644]
docs/examples/full-sample_PXML.xml [new file with mode: 0644]
docs/examples/minimum-libpnd_PXML.xml [new file with mode: 0644]
docs/examples/minimum-schema_PXML.xml [new file with mode: 0644]

index e756003..335efe5 100644 (file)
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <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">
        
+       
+       <!-- declare some simpleTypes for later usage -->
+       
+       <!-- Specify params allows with the 'x11' entry in exec -->
        <xs:simpleType name="x11Param">
                <xs:restriction base="xs:string">
                        <xs:enumeration value="req" />
@@ -9,6 +13,7 @@
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- Specify the valid documentation formats in the <info> block -->
        <xs:simpleType name="docType">
                <xs:restriction base="xs:string">
                        <xs:enumeration value="text/html" />
@@ -16,6 +21,7 @@
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- Make sure that version numbers only consist of letters, numbers and + as well as - -->
        <xs:simpleType name="versionNumber">
                <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- Specify what is valid as release type -->
+       <xs:simpleType name="releaseType">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="alpha" />
+                       <xs:enumeration value="beta" />
+                       <xs:enumeration value="release" />
+               </xs:restriction>
+       </xs:simpleType>
+       
+       <!-- Specify what makes an email address "valid" -->
        <xs:simpleType name="emailAddress">
                <xs:restriction base="xs:string">
                        <xs:pattern value="[^@]+@[^\.]+\..+"/>
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- some restrictions regarding file names that are eg not allowed/possible when using sd cards formated as fat32 -->
        <xs:simpleType name="dumbPath">
                <xs:restriction base="xs:normalizedString">
                        <xs:pattern value="[^?>:]+" />
                </xs:restriction>
        </xs:simpleType>
-       
        <xs:simpleType name="dumbFolderName">
                <xs:restriction base="xs:normalizedString">
                        <xs:pattern value="[^?>:/]+" />
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- Specify lang codes -->
        <xs:simpleType name="isoLangcode">
                <xs:restriction base="xs:string">
                        <xs:minLength value="2"/>
                        <xs:pattern value="[a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})*" />
                </xs:restriction>
        </xs:simpleType>
+       <xs:simpleType name="isoLangcode_en_US">
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="en_US" />
+               </xs:restriction>
+       </xs:simpleType>
        
        <!-- Definition of all allowed categories following the FDO specs -->
        <xs:simpleType name="fdoCategory">
                <xs:restriction base="xs:string">
-                       <xs:pattern value="AudioVideo|Audio|Video|Development|Education|Game|Graphics|Network|Office"/>
+                       <xs:pattern value="AudioVideo|Audio|Video|Development|Education|Game|Graphics|Network|Office|Settings|System|Utility"/>
                </xs:restriction>
        </xs:simpleType>
-       
-       <!-- Definition of all allowed subcategories following the FDO specs -->
+       <!-- 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) -->
        <xs:simpleType name="fdoSubCategory">
                <xs:restriction base="xs:string">
                        <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"/>
                </xs:restriction>
        </xs:simpleType>
        
+       <!-- Create some way to enforce entries to be nonempty -->
+       <xs:simpleType name="nonempty_token">
+               <xs:restriction base="xs:token">
+                       <xs:minLength value="1"/>
+               </xs:restriction>
+       </xs:simpleType>
+               <xs:simpleType name="nonempty_string">
+               <xs:restriction base="xs:string">
+                       <xs:minLength value="1"/>
+               </xs:restriction>
+       </xs:simpleType>
+               <xs:simpleType name="nonempty_normalizedString">
+               <xs:restriction base="xs:string">
+                       <xs:minLength value="1"/>
+               </xs:restriction>
+       </xs:simpleType>
+       
+       
+       
+       <!-- declare some complexTypes for later usage -->
+       
+       <!-- type used for file associations -->
+       <xs:complexType name="association_data">
+               <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
+               <xs:attribute name="filetype" use="required" type="nonempty_token" />
+               <xs:attribute name="exec" use="required" type="nonempty_token" />
+       </xs:complexType>
+       
+       <!-- type used for author info -->
+       <xs:complexType name="author_data">
+               <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
+               <xs:attribute name="website" use="optional" type="xs:anyURI" />
+               <xs:attribute name="email" use="optional" type="emailAddress" />
+       </xs:complexType>
+       
+       <!-- type used for version informations (full entry as well as os version) -->
+       <xs:complexType name="app_version_info">
+               <xs:attribute name="major" use="required" type="versionNumber" />
+               <xs:attribute name="minor" use="required" type="versionNumber" />
+               <xs:attribute name="release" use="required" type="versionNumber" />
+               <xs:attribute name="build" use="required" type="versionNumber" />
+               <xs:attribute name="type" use="optional" type="releaseType" />
+       </xs:complexType>
+       <xs:complexType name="os_version_info">
+               <xs:attribute name="major" use="required" type="versionNumber" />
+               <xs:attribute name="minor" use="required" type="versionNumber" />
+               <xs:attribute name="release" use="required" type="versionNumber" />
+               <xs:attribute name="build" use="required" type="versionNumber" />
+       </xs:complexType>
+       
+       <!-- type used for exec entries -->
+       <xs:complexType name="exec_params">
+               <xs:attribute name="command" use="required" type="nonempty_token" />
+               <xs:attribute name="arguments" use="optional" type="nonempty_token" />
+               <xs:attribute name="background" use="optional" type="xs:boolean" />
+               <xs:attribute name="startdir" use="optional" type="dumbPath" />
+               <xs:attribute name="standalone" use="optional" type="xs:boolean" />
+               <xs:attribute name="x11" use="optional" type="x11Param" />
+       </xs:complexType>
+       
+       <!-- type used for tiles or descriptions, once in 'normal' version, once enforcing usage of en_US -->
+       <xs:complexType name="title_or_description">
+               <xs:simpleContent>
+                       <xs:extension base="nonempty_string">
+                               <xs:attribute name="lang" use="required" type="isoLangcode" />
+                       </xs:extension>
+               </xs:simpleContent>
+       </xs:complexType>
+       <xs:complexType name="title_or_description_enUS">
+               <xs:simpleContent>
+                       <xs:extension base="nonempty_string">
+                               <xs:attribute name="lang" use="required" type="isoLangcode_en_US" />
+                       </xs:extension>
+               </xs:simpleContent>
+       </xs:complexType>
+       
+       <!-- type used for referencing images -->
+       <xs:complexType name="image_entry">
+               <xs:attribute name="src" use="required" type="dumbPath" />
+       </xs:complexType>
+       
+       <!-- type for referencing manuals/readme docs -->
+       <xs:complexType name="information_entry">
+               <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
+               <xs:attribute name="type" use="required" type="docType" />
+               <xs:attribute name="src" use="required" type="dumbPath" />
+       </xs:complexType>
+       
+       <!-- type used for the license information -->
+       <xs:complexType name="license_info">
+               <xs:attribute name="name" use="required" type="nonempty_normalizedString" />
+               <xs:attribute name="url" use="optional" type="xs:anyURI" />
+               <xs:attribute name="sourcecodeurl" use="optional" type="xs:anyURI" />
+       </xs:complexType>
+       
+       
+       
+       <!-- Combine the symple and complex types into the "real" PXML specification -->
        
        <xs:element name="PXML">
                <xs:complexType>
                        <xs:sequence>
-                               <xs:element name="application" minOccurs="1" maxOccurs="unbounded">
+                               <!-- specify the <package> tag with info about the complete package, information providable:
+                                       author
+                                       version
+                                       title(s)
+                                       description(s)
+                                       icon
+                                       -->
+                               <xs:element name="package" minOccurs="1" maxOccurs="1">
                                        <xs:complexType>
-                                               <xs:sequence>
-                                                       <!--Execution params -->
-                                                       <xs:element name="exec" minOccurs="1">
+                                               <xs:all>
+                                                       <!--Author info-->
+                                                       <xs:element name="author" type="author_data" minOccurs="1" />
+                                                       <!--App version info-->
+                                                       <xs:element name="version" type="app_version_info" minOccurs="1" />
+                                                       <!--Title-->
+                                                       <xs:element name="titles" minOccurs="1">
                                                                <xs:complexType>
-                                                                       <xs:attribute name="command" use="required" type="xs:token" />
-                                                                       <xs:attribute name="arguments" use="optional" type="xs:token" />
-                                                                       <xs:attribute name="background" use="optional" type="xs:boolean" />
-                                                                       <xs:attribute name="startdir" use="optional" type="dumbPath" />
-                                                                       <xs:attribute name="standalone" use="optional" type="xs:boolean" />
-                                                                       <xs:attribute name="x11" use="optional" type="x11Param" />
+                                                                       <xs:sequence>
+                                                                               <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
+                                                                               <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
+                                                                       </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
-                                                       <!--Title-->
-                                                       <xs:sequence>
-                                                               <xs:element name="title" minOccurs="1" maxOccurs="unbounded">
-                                                                       <xs:complexType>
-                                                                               <xs:simpleContent>
-                                                                                       <xs:extension base="xs:string">
-                                                                                               <xs:attribute name="lang" type="isoLangcode" />
-                                                                                       </xs:extension>
-                                                                               </xs:simpleContent>
-                                                                       </xs:complexType>
-                                                               </xs:element>
-                                                       </xs:sequence>
-                                                       <!--Author info-->
-                                                       <xs:element name="author" minOccurs="1">
+                                                       <!--Description-->
+                                                       <xs:element name="descriptions" minOccurs="0">
                                                                <xs:complexType>
-                                                                       <xs:attribute name="name" use="required" type="xs:normalizedString" />
-                                                                       <xs:attribute name="website" use="optional" type="xs:anyURI" />
-                                                                       <xs:attribute name="email" use="optional" type="emailAddress" />
+                                                                       <xs:sequence>
+                                                                               <xs:element name="title" type="title_or_description_enUS" minOccurs="0" maxOccurs="1" />
+                                                                               <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
+                                                                       </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
+                                                       <!--Icon-->
+                                                       <xs:element name="icon" type="image_entry" minOccurs="0" />
+                                               </xs:all>
+                                               <!--Package ID-->
+                                               <xs:attribute name="id" use="required" type="dumbFolderName" />
+                                       </xs:complexType>
+                               </xs:element>
+                               <!-- specify the <application> tag with info about a single program
+                                       executable call
+                                       author
+                                       version (of the application)
+                                       osversion (min OS version supported)
+                                       title(s) (allowing compatibility to <HF6, too!)
+                                       description(s) (allowing compatibility to <HF6, too!)
+                                       icon
+                                       license
+                                       preview pictures
+                                       info/manual/readme entry
+                                       categories
+                                       associations to file types
+                                       clockspeed
+                                       -->
+                               <xs:element name="application" minOccurs="1" maxOccurs="unbounded">
+                                       <xs:complexType>
+                                               <xs:all>
+                                                       <!--Execution params -->
+                                                       <xs:element name="exec" type="exec_params" minOccurs="1" />
+                                                       <!--Author info-->
+                                                       <xs:element name="author" type="author_data" minOccurs="1" />
                                                        <!--App version info-->
-                                                       <xs:element name="version" minOccurs="1">
+                                                       <xs:element name="version" type="app_version_info" minOccurs="1" />
+                                                       <!--OS Version info-->
+                                                       <xs:element name="osversion" type="os_version_info" minOccurs="0" />
+                                                       <!--Title-->
+                                                       <!-- via <titles> element, used for HF6+ -->
+                                                       <xs:element name="titles" minOccurs="1">
                                                                <xs:complexType>
-                                                                       <xs:attribute name="major" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="minor" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="release" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="build" use="required" type="versionNumber" />
+                                                                       <xs:sequence>
+                                                                               <xs:element name="title" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
+                                                                               <xs:element name="title" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
+                                                                       </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
-                                                       <!--OS Version info-->
-                                                       <xs:element name="osversion" minOccurs="0">
+                                                       <!--Title-->
+                                                       <!-- via <title> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
+                                                       <xs:element name="title" type="title_or_description_enUS" minOccurs="0" />
+                                                       <!--Description-->
+                                                       <!-- via <descriptions> element, used for HF6+ -->
+                                                       <xs:element name="descriptions" minOccurs="0">
                                                                <xs:complexType>
-                                                                       <xs:attribute name="major" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="minor" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="release" use="required" type="versionNumber" />
-                                                                       <xs:attribute name="build" use="required" type="versionNumber" />
+                                                                       <xs:sequence>
+                                                                               <xs:element name="description" type="title_or_description_enUS" minOccurs="1" maxOccurs="1" />
+                                                                               <xs:element name="description" type="title_or_description" minOccurs="0" maxOccurs="unbounded" />
+                                                                       </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
                                                        <!--Description-->
-                                                       <xs:sequence>
-                                                               <xs:element name="description" minOccurs="0" maxOccurs="unbounded">
-                                                                       <xs:complexType>
-                                                                               <xs:simpleContent>
-                                                                                       <xs:extension base="xs:string">
-                                                                                               <xs:attribute name="lang" use="required" type="isoLangcode" />
-                                                                                       </xs:extension>
-                                                                               </xs:simpleContent>
-                                                                       </xs:complexType>
-                                                               </xs:element>
-                                                       </xs:sequence>
+                                                       <!-- via <description> element, only one for en_US allowed, meant for backwards compatibility with libpnd from <HF6 -->
+                                                       <xs:element name="description" type="title_or_description_enUS" minOccurs="0" />
                                                        <!--Icon-->
-                                                       <xs:element name="icon" minOccurs="0">
+                                                       <xs:element name="icon" type="image_entry" minOccurs="0" />
+                                                       <!--License-->
+                                                       <xs:element name="licenses" minOccurs="1">
                                                                <xs:complexType>
-                                                                       <xs:attribute name="src" use="required" type="dumbPath" />
+                                                                       <xs:sequence>
+                                                                               <xs:element name="license" type="license_info" minOccurs="1" maxOccurs="unbounded" />
+                                                                       </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
                                                        <!--Preview pics-->
                                                        <xs:element name="previewpics" minOccurs="0">
                                                                <xs:complexType>
                                                                        <xs:sequence>
-                                                                               <xs:element name="pic" minOccurs="0" maxOccurs="unbounded">
-                                                                                       <xs:complexType>
-                                                                                               <xs:attribute name="src" use="required" type="dumbPath" />
-                                                                                       </xs:complexType>
-                                                                               </xs:element>
+                                                                               <xs:element name="pic" type="image_entry" minOccurs="0" maxOccurs="unbounded" />
                                                                        </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
                                                        <!--Info (aka manual or readme entry)-->
-                                                       <xs:element name="info" minOccurs="0">
-                                                               <xs:complexType>
-                                                                       <xs:attribute name="name" use="required" type="xs:normalizedString" />
-                                                                       <xs:attribute name="type" use="required" type="docType" />
-                                                                       <xs:attribute name="src" use="required" type="dumbPath" />
-                                                               </xs:complexType>
-                                                       </xs:element>
+                                                       <xs:element name="info" type="information_entry" minOccurs="0" />
                                                        <!--Categories-->
                                                        <xs:element name="categories" minOccurs="1">
                                                                <xs:complexType>
                                                                        <xs:sequence>
-                                                                               <xs:element name="category" maxOccurs="unbounded">
+                                                                               <xs:element name="category" minOccurs="1" maxOccurs="unbounded">
                                                                                        <xs:complexType>
                                                                                                <xs:sequence>
-                                                                                                       <xs:element name="subcategory" maxOccurs="unbounded">
+                                                                                                       <xs:element name="subcategory" minOccurs="0" maxOccurs="unbounded">
                                                                                                                <xs:complexType>
                                                                                                                        <xs:attribute name="name" type="fdoSubCategory" />
                                                                                                                </xs:complexType>
                                                        <xs:element name="associations" minOccurs="0">
                                                                <xs:complexType>
                                                                        <xs:sequence>
-                                                                               <xs:element name="association" maxOccurs="unbounded">
-                                                                                       <xs:complexType>
-                                                                                               <xs:attribute name="name" use="required" type="xs:normalizedString" />
-                                                                                               <xs:attribute name="filetype" use="required" type="xs:token" />
-                                                                                               <xs:attribute name="arguments" use="required" type="xs:token" />
-                                                                                       </xs:complexType>
-                                                                               </xs:element>
+                                                                               <xs:element name="association" type="association_data" maxOccurs="unbounded" />
                                                                        </xs:sequence>
                                                                </xs:complexType>
                                                        </xs:element>
                                                                        <xs:attribute name="frequency" use="required" type="xs:positiveInteger" />
                                                                </xs:complexType>
                                                        </xs:element>
-                                               </xs:sequence>
+                                               </xs:all>
                                                <!--AppID-->
                                                <xs:attribute name="id" use="required" type="dumbFolderName" />
                                                <xs:attribute name="appdata" use="optional" type="dumbFolderName" />
index 98e8f69..443ab98 100644 (file)
@@ -1,29 +1,67 @@
-
 NOTES:
-
-Note 1) PXML_schema.xsd is overly picky about line-ordering; the line order is not required in practice,
-        but requiring the ordering makes the validator happy; this the validator may reject a valid PXML.xml
-Note 2) libpnd is not (currently) as picky as the validator (since it only consumes some values, and will
+Note 1) libpnd is not (currently) as picky as the validator (since it only consumes some values, and will
         sometimes 'trust' bad values in hopes things will just work anyway), but many of the online download
-        repositories _will_ use this validator, so it is probably a good idea to make your PXMLs conform!
-Note 3) These points aside -- anything passing the validator should pass into libpnd just fint; PXML.xmls that
+        repositories _will_ use this validator, so it is probably a good idea to make your PXMLs conform! For
+        example the <package> block is currently not used/required for libpnd to work.
+Note 2) These points aside -- anything passing the validator should pass into libpnd just fine; PXML.xmls that
         do not pass the validator may well work with libpnd, depending on the nature of the rejection --
         if the PXML.xml is just bad, fix it! But if the validator rejects the PXML.xml on grounds of
         bad categories or line ordering or whatever, then libpnd will 'accept' the application, but may
-        massage things to work.
-Note 4) minimenu and xfce and other Freedesktop Statandard adhering applications may actually be pickier about
+        massage things to work (eg add the application into the category 'Other' or do some more obscure things).
+Note 3) minimenu and xfce and other Freedesktop Standard adhering applications may actually be pickier about
         some things than the validator -- the validator will verify the categories and subcategories are
         known to the Freedesktop spec, but does not validate that a FD subcategory actually belongs to the
         listed parent category. 
 
+How to read this doc:
+* Every entry comes with a cardinality. Here is the meaning of those:
+  =1: this block is required exactly once
+  <=1: up to one of those blocks is allowed (0 or 1)
+  >=1: at least one of those is allowed, more are possible but optional
+  >=0: optional element that can be added in unlimited numbers
+* The actually used 'tag's are always displayed in this form: <tag>.
+* Arguments are always marked either as optional or required and mention what allowed values are. At the bottom
+  of this doc is an explanation of most of those values. If you see [abc|xyz] it means that either 'abc' or
+  'xyz' are valid values.
+* In general 'order' of elements does not matter unless stated otherwise.
+* If a block is used, the content is usually *NOT* allowed to be empty. So if you don't want to use something,
+  don't specify that argument!
+
+
 Now, onto the actual specification:
 
-1) at the root there is *exactly* one PXML block
-2) inside this PXML block are >=1 <application> blocks
+1) at the root there is *exactly* one <PXML> block
+2) inside this PXML block is exactly =1 <package> block
+        (required) id=DUMBFOLDERNAME
+3) inside this PXML block are >=1 <application> blocks
         (required) id=DUMBFOLDERNAME
         (optional) appdata=DUMBFOLDERNAME
 
-inside each application block:
+
+inside the <package> block:
+1) =1 <author>
+        (required) name=TEXT
+        (optional) website=anyURI
+        (optional) email=EMAILADDRESS
+2) =1 <version>
+        (required) major=VERSION_NR
+        (required) minor=VERSION_NR
+        (required) release=VERSION_NR
+        (required) build=VERSION_NR
+        (optional) type=[alpha|beta|release]
+3) =1 <titles> (order matters!)
+        (required) =1 <description lang="en_US">TEXT</description> (enforcing that an en_US string is available, has to be listed first)
+        (optional) >=1 <title>TEXT</title>
+                        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
+4) <=1 <descriptions> (order matters!)
+        (required) =1 <description lang="en_US">TEXT</description> (enforcing that an en_US string is available, has to be listed first)
+        (optional) >=0 <description>TEXT</description>
+                        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
+5) <=1 <icon>
+        (required) src=DUMBPATH
+
+
+inside each <application> block:
 1) =1 <exec>
         (required) command=TOKEN
         (optional) arguments=TOKEN
@@ -31,49 +69,61 @@ inside each application block:
         (optional) startdir=DUMBPATH
         (optional) standalone=BOOLEAN
         (optional) x11=[req|stop|ignore]
-2) >=1 <title>TEXT</title>
-        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
-3) =1 <author>
+2) =1 <author>
         (required) name=TEXT
         (optional) website=anyURI
         (optional) email=EMAILADDRESS
-4) =1 <version>
+3) =1 <version>
         (required) major=VERSION_NR
         (required) minor=VERSION_NR
         (required) release=VERSION_NR
         (required) build=VERSION_NR
-5) <=1 <osversion>
+        (optional) type=[alpha|beta|release] (if not specified 'release' will be assumed)
+4) <=1 <osversion>
         (required) major=VERSION_NR
         (required) minor=VERSION_NR
         (required) release=VERSION_NR
         (required) build=VERSION_NR
-6) >=0 <description>TEXT</description>
-        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
-7) <=1 <icon>
+5) =1 <titles> (order matters!)
+        (required) =1 <title lang="en_US">TEXT</title> (enforcing that an en_US string is available, has to be listed first)
+        (optional) >=0 <title>TEXT</title>
+                        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
+6) <=1 <title lang="en_US">TEXT</title> (meant for compatibility with <=HF6, only en_US supported)
+7) <=1 <descriptions> (order matters!)
+        (required) =1 <description lang="en_US">TEXT</description> (enforcing that an en_US string is available, has to be listed first)
+        (optional) >=0 <description>TEXT</description>
+                        (required) lang=LANGCODE ( [a-zA-Z]{2,3}(_[a-zA-Z0-9]{2,3})* )
+8) <=1 <description lang="en_US">TEXT</description> (meant for compatibility with <=HF6, only en_US supported)
+9) <=1 <icon>
         (required) src=DUMBPATH
-8) <=1 <previewpics>
+10)=1 <licenses>
+        (required) >=1 <license>
+                        (required) name=TEXT
+                        (required) url=anyURI
+                        (required) sourcecodeurl=anyURI
+11)<=1 <previewpics>
         (optional) >=0 <pic>
                         (required) src=DUMBPATH
-9) <=1 <info>
+12)<=1 <info>
         (required) name=TEXT
         (required) type=[text/html|text/plain]
         (required) src=DUMBPATH
-10)=1 <categories>
+13)=1 <categories>
         (required) >=1 <category>
                         (required) name=fdoCategory
                         (optional) <subcategory>
                                   (required) name=fdoSubCategory
-11)<=1 <associations>
+14)<=1 <associations>
         (required) >=1 <association>
                         (required) name=TEXT
                         (required) filetype=TOKEN
                         (required) arguments=TOKEN
-12)<=1 <clockspeed>
+15)<=1 <clockspeed>
         (required) frequency=positiveInteger
 
 
 
-Filetype/variable explaination:
+Filetype/variable explanation:
 anyURI: should be some URL, no idea what exactly XML accepts there... (XML variable 'anyURI'!)
 BOOLEAN: 0 or 1 or true or false (XML variable 'boolean'!)
 DUMBFOLDERNAME: TEXT without ?>:/
index 13075bb..7b0bee5 100644 (file)
@@ -1,3 +1,8 @@
 The best and most-current PXML example (if overly comprehensive) is here:
 
 http://pandorawiki.org/PXML_archetype
+
+Various stages of PXML.xml files are shown here. They show the minimum that
+still validates with the schema, the minimum that is usable on the pandora, as
+well as some examples of average and "full" case. At the top of each file you
+will find a short summary what this PXML.xml file tries to show.
index 76f1e11..c42003a 100644 (file)
@@ -1,43 +1,80 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<PXML xmlns="http://openpandora.org/namespaces/PXML" 
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="youruniqueID" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
-  <title lang="en_US">Program Title</title>
-  <title lang="de_DE">German Program Title</title>
+<!-- This is a sample PXML.xml file making use of many different things.-->
+<PXML xmlns="http://openpandora.org/namespaces/PXML">
 
-  <exec background="true" startdir="/usr/share/icons/" standalone="true" command="program.exe"/>
+  <package id="some_unique_package_id">
 
-  <icon src="program.png"/>
+    <version major="1" minor="17" release="3" build="4" type="beta"/>
 
-  <description lang="en_US">This is the English Description of the file.</description>
-  <description lang="de_DE">This would be the German description.</description>
+    <author name="the packagers name" website="http://www.openpandora.org"/>
 
-  <previewpics>
-    <pic src="./preview/pic1.jpg"/>
-    <pic src="./preview/pic2.jpg"/>
-  </previewpics>
+    <titles>
+      <title lang="en_US">Program Title</title>
+      <title lang="de_DE">German Program Title</title>
+    </titles>
 
-  <author name="EvilDragon" website="http://www.openpandora.org"/><!--Optional email and website, name required-->
+    <descriptions>
+      <description lang="en_US">This is the English Description of the file.</description>
+      <description lang="de_DE">This would be the German description.</description>
+    </descriptions>
 
-  <version major="1" minor="1" release="1" build="2"/><!--This program's version-->
-  <osversion major="1" minor="0" release="0" build="0"/><!--The minimum OS version required-->
+    <icon src="my-icon.png"/>
 
-  <categories>
-    <category name="Main category"><!--category like "Games", "Graphics", "Internet" etc-->
-    <subcategory name="Subcategory 1"/><!--subcategory, like "Board Games", "Strategy", "First Person Shooters"-->
-    <subcategory name="Subcategory 2"/>
-    </category>
-    <category name="Alternative category">
-      <subcategory name="Alternative Subcategory 1"/>
-    </category>
-  </categories>
+  </package>
 
-  <associations>
-    <!--File associations, with a short description, an extension, and start params.-->
-    <association name="View Word File" filetype="application/msword" exec="-f %s -t doc"/>
-  </associations>
 
-  <clockspeed frequency="600"/><!--Frequency in Hz-->
+  <application id="youruniqueID">
+    <exec background="true" startdir="/usr/share/icons/" standalone="true" command="program.exe"/>
+
+    <version major="1" minor="1" release="1" build="2" type="release"/> <!--This program's version-->
+
+    <osversion major="1" minor="0" release="0" build="0"/> <!--The minimum OS version required-->
+
+    <author name="EvilDragon" website="http://www.openpandora.org"/> <!--Optional email and website, name required-->
+
+    <titles>
+      <title lang="en_US">Program Title</title>
+      <title lang="de_DE">German Program Title</title>
+    </titles>
+    <title lang="en_US">Program Title</title> <!--Extra <title> block for compatibility with OS versions before HF6-->
+
+    <descriptions>
+      <description lang="en_US">This is the English Description of the file.</description>
+      <description lang="de_DE">This would be the German description.</description>
+    </descriptions>
+    <description lang="en_US">This is the English Description of the file.</description> <!--Extra <description> block for compatibility with OS versions before HF6-->
+
+    <icon src="my-icon.png"/>
+
+    <licenses>
+      <license name="GPLv2+" url="http://www.gnu.org/licenses/gpl-2.0.html" sourcecodeurl="http://openpandora.org/sources/package.tar.bz2"/><!--Optional url and sourcecodeurl, mandatory name-->
+    </licenses>
+
+    <previewpics>
+      <pic src="./preview/pic1.jpg"/>
+      <pic src="./preview/pic2.jpg"/>
+    </previewpics>
+
+    <info name="Readme" type="text/html" src="readme.html"/>
+
+    <!--the categories has to conform to the FDO categories, those will be enforced by the schema and libpnd!-->
+    <categories>
+      <category name="Utility"><!--Main category: a category like "Game", "Graphics", "Network", etc-->
+        <subcategory name="FileTools"/><!--Subcategory 1: a subcategory, like "BoardGame", "StrategyGame", "ActionGame"-->
+        <subcategory name="Archiving"/><!--Subcategory2: another subcategory, but make sure to match the main category, too!-->
+      </category>
+         <category name="System"><!--Alternative category-->
+        <subcategory name="Filesystem"/><!--Alternative Subcategory 1-->
+      </category>
+    </categories>
+
+    <associations>
+      <!--File associations, with a short description, an extension, and start params.-->
+      <association name="View Word File" filetype="application/msword" exec="-f %s -t doc"/>
+    </associations>
+
+    <clockspeed frequency="600"/><!--Frequency in Hz-->
+
+  </application>
 
-  <configuration for="gmenupandora">......kfujl........</configuration><!--random data, this is for specific menus-->
-  <configuration for="anothermenu">......qwe......fwer.....</configuration>
 </PXML>
diff --git a/docs/examples/average-case_PXML.xml b/docs/examples/average-case_PXML.xml
new file mode 100644 (file)
index 0000000..bb2e1d1
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is an example how a "common" pnd with just one application could look. Most of the information for the <package> block can in this case directly be copied over from the respective parts in the <application> block.-->
+<PXML xmlns="http://openpandora.org/namespaces/PXML">
+  <package id="sample-app">
+    <version major="1" minor="17" release="3" build="4"/>
+    <author name="the authors name" website="http://www.openpandora.org"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+      <title lang="de_DE">Beispiel Anwendung</title>
+    </titles>
+    <descriptions>
+      <description lang="en_US">A really lenghty description for the application.</description>
+      <description lang="de_DE">Die Beschreibung einer Beispielanwendung.</description>
+    </descriptions>
+    <icon src="my-icon.png"/>
+  </package>
+  
+  <application id="sample-app">
+    <exec command="run.sh" x11="req"/>
+    <version major="1" minor="17" release="3" build="4"/>
+    <author name="the authors name" website="http://www.openpandora.org"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+      <title lang="de_DE">Beispiel Anwendung</title>
+    </titles>
+    <title lang="en_US">Sample Application</title> <!--Extra block for compatibility with OS versions before HF6-->
+    <descriptions>
+      <description lang="en_US">A really lenghty description for the application.</description>
+      <description lang="de_DE">Die Beschreibung einer Beispielanwendung.</description>
+    </descriptions>
+    <description lang="en_US">A really lenghty description for the application.</description> <!--Extra block for compatibility with OS versions before HF6-->
+    <icon src="my-icon.png"/>
+    <licenses>
+      <license name="GPLv2+" url="http://www.gnu.org/licenses/gpl-2.0.html" sourcecodeurl="http://pandora.org/sources/package.tar.bz2"/>
+    </licenses>
+    <previewpics>
+      <pic src="preview-image.png"/>
+    </previewpics>
+    <info name="Readme" type="text/html" src="readme.html"/>
+    <categories>
+      <category name="Game">
+        <subcategory name="StrategyGame"/>
+      </category>
+    </categories>
+  </application>
+</PXML>
diff --git a/docs/examples/full-sample_PXML.xml b/docs/examples/full-sample_PXML.xml
new file mode 100644 (file)
index 0000000..01b3bea
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is an complex example defining a "real" package collection. It offers several applications, all using different features of PXML.-->
+<PXML xmlns="http://openpandora.org/namespaces/PXML">
+  <package id="sample-package">
+    <version major="1" minor="0" release="0" build="0" type="release"/>
+    <author name="packagers name" website="http://www.website.foo" email="user@name.who"/>
+    <titles>
+      <title lang="en_US">Sample Collection</title>
+      <title lang="de_DE">Beispiel Sammlung</title>
+    </titles>
+    <descriptions>
+      <description lang="en_US">This is a really verbose package with a whole lot of stuff from 2 different sources, mixing different things, having stuff in ways sometimes making use of stuff, often not.</description>
+      <description lang="de_DE">Die gleiche Beschreibung wie oben, nur auf deutsch.</description>
+    </descriptions>
+    <icon src="my-icon.png"/>
+  </package>
+  
+  <application id="sample-app1">
+    <exec command="run.sh" x11="req"/>
+    <version major="1" minor="18" release="0" build="0" type="alpha"/>
+    <author name="the authors name" website="http://www.openpandora.org"/>
+    <titles>
+      <title lang="en_US">Sample Application 1</title>
+      <title lang="de_DE">Beispiel Anwendung 1</title>
+    </titles>
+    <title lang="en_US">Sample Application 1</title> <!--Extra block for compatibility with OS versions before HF6-->
+    <descriptions>
+      <description lang="en_US">A really lenghty description for the application.</description>
+      <description lang="de_DE">Die Beschreibung einer Beispielanwendung.</description>
+    </descriptions>
+    <description lang="en_US">A really lenghty description for the application.</description> <!--Extra block for compatibility with OS versions before HF6-->
+    <icon src="my-icon.png"/>
+    <previewpics>
+      <pic src="preview-image.png"/>
+      <pic src="application_1.png"/>
+    </previewpics>
+    <info name="Readme" type="text/html" src="readme.html"/>
+    <licenses>
+      <license name="I do as I please" sourcecodeurl="git://git.openpandora.org/special_project"/>
+    </licenses>
+    <categories>
+      <category name="Game">
+        <subcategory name="Emulator"/>
+      </category>
+      <category name="System">
+        <subcategory name="Emulator"/>
+      </category>
+    </categories>
+  </application>
+  
+  <application id="sample-app2" appdata="sample-app1">
+    <exec command="run2.sh"/>
+    <version major="1" minor="17" release="3" build="4" type="release"/>
+    <author name="the authors name" website="http://www.openpandora.org"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+      <title lang="de_DE">Beispiel Anwendung</title>
+    </titles>
+    <title lang="en_US">Sample Application</title> <!--Extra block for compatibility with OS versions before HF6-->
+    <descriptions>
+      <description lang="en_US">A really lenghty description for the application. Just different</description>
+      <description lang="de_DE">Die Beschreibung einer *anderen* Beispielanwendung.</description>
+      <description lang="fr_FR">This is in french!</description>
+    </descriptions>
+    <description lang="en_US">A really lenghty description for the application. Just different</description> <!--Extra block for compatibility with OS versions before HF6-->
+    <info name="Readme (old)" type="text/html" src="readme_old.html"/>
+    <icon src="my-icon2.png"/>
+    <licenses>
+      <license name="other" url="http://openpandora.org/pandora_special.html"/>
+      <license name="Qt-commercial" url="http://url.openpandora.org/commercial_license.html"/>
+      <license name="public domain"/>
+      <license name="GPLv2+" url="http://www.gnu.org/licenses/gpl-2.0.html" sourcecodeurl="http://pandora.org/sources/package.tar.bz2"/>
+    </licenses>
+    <categories>
+      <category name="Game">
+        <subcategory name="StrategyGame"/>
+      </category>
+    </categories>
+  </application>
+  
+  <application id="sample-app3">
+    <exec command="bin/tool" standalone="false"/>
+    <version major="1" minor="0" release="0" build="1"/>
+    <author name="completely different author" website="http://www.website.foo" email="user@name.who"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+    </titles>
+    <title lang="en_US">Sample Application</title> <!--Extra block for compatibility with OS versions before HF6-->
+    <descriptions>
+      <description lang="en_US">Additional tool description.</description>
+    </descriptions>
+    <description lang="en_US">Additional tool description.</description> <!--Extra block for compatibility with OS versions before HF6-->
+    <icon src="no-real-icon.png"/>
+    <licenses>
+      <license name="GPLv2+" url="http://www.gnu.org/licenses/gpl-2.0.html" sourcecodeurl="http://pandora.org/sources/package.tar.bz2"/>
+    </licenses>
+    <previewpics>
+      <pic src="different-preview-image.png"/>
+    </previewpics>
+    <categories>
+      <category name="System">
+      </category>
+    </categories>
+    <associations>
+      <association name="Deinterlaced Bitmap Image" filetype="image/bmp" exec="-f %s --no-deinterlacing"/>
+      <association name="Style sheet system crasher" filetype="text/css" exec="-f %s --crash-on-success"/>
+    </associations>
+  </application>
+</PXML>
diff --git a/docs/examples/minimum-libpnd_PXML.xml b/docs/examples/minimum-libpnd_PXML.xml
new file mode 100644 (file)
index 0000000..1532c40
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a minimum example that will work on the pandora, but is *not* following the schema and lots of information that will be required for repositories based on the PXML specs is not available. -->
+<PXML xmlns="http://openpandora.org/namespaces/PXML">
+  <application id="sample-app">
+    <exec command="run.sh"/>
+    <title lang="en_US">Sample Application</title>
+  </application>
+</PXML>
diff --git a/docs/examples/minimum-schema_PXML.xml b/docs/examples/minimum-schema_PXML.xml
new file mode 100644 (file)
index 0000000..9c6bd1b
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a minimum example that will validate with the schema but basically offer nothing beside what really is required. This application should work nicely with any pnd repositories based upon the PXML specs.
+     NOTE: This application will not work with pre HF6, for support for OS versions up to HF6 an additional <title> block outside of <titles> is required!-->
+<PXML xmlns="http://openpandora.org/namespaces/PXML">
+  <package id="sample-package">
+    <version major="1" minor="17" release="3" build="4"/>
+    <author name="the authors name"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+    </titles>
+  </package>
+  
+  <application id="sample-app">
+    <exec command="run.sh"/>
+    <titles>
+      <title lang="en_US">Sample Application</title>
+    </titles>
+       <!--<title lang="en_US">Sample Application</title>--> <!--Extra block for compatibility with OS versions before HF6-->
+    <author name="the authors name"/>
+    <version major="1" minor="17" release="3" build="4"/>
+    <licenses>
+      <license name="other"/>
+    </licenses>
+    <categories>
+      <category name="Game"/>
+    </categories>
+  </application>
+</PXML>