Pxml Updated


EvilDragon

Administrator
Staff member
Joined
Mar 4, 2003
Messages
29,986
Age
47
Location
Ingolstadt
Hi,

I just updated the PXML format.
It's now valide, which makes it easier to use.

Also, a few new features are included :)

If you have any questions or ideas, simply post to this thread :)

Download: PXML Format Definition v1.2
 
does the .PXML file extension have to be uppercase? as the pandora uses linux, and unix stuff is all case sensitive, we may have problems if the case is not specified. unless you plan on using a regex to find pxml files!
 
parag0n said:
does the .PXML file extension have to be uppercase? as the pandora uses linux, and unix stuff is all case sensitive, we may have problems if the case is not specified. unless you plan on using a regex to find pxml files!
I don't think that will matter, as the pxml files will typically be on a fat32 formatted sd card, which doesn't support case sensitive filenames. I'd recommend the use of lowercasing the extension however just in case people reformat there cards as ext2 or similar.
 
Last edited by a moderator:
Chip said:
Wikified.

If you make any changes to the standard, please let me know so I can keep the wiki version accurate. :)


Chip, the catlangs.pxml example is missing a </category> tag.
 
Last edited by a moderator:
Where is this linked _From_ in the wiki?

I think we need a Development Documentation page (in addition to the tools page) with links like this, the chip docs, etc. (Or maybe I'm missing it..)

Don't want to loose all this info :)

jeff
 
Caine said:
Chip said:
Wikified.

If you make any changes to the standard, please let me know so I can keep the wiki version accurate. :)


Chip, the catlangs.pxml example is missing a </category> tag.


Yes, and also:

CODE
<category = 'Games'>


Is that correct XML? I've never seen nothing like that, shouldn't be <category name='Games'>? I don't know if it's possible to parse with Qt's XML module. I'll investigate..

Any of these files should be written by the GUIs? Or do the GUIs should have its own configuration files? What I've understand is that pxml files are downloaded with the package and should not be modified by the user/GUI. But I wonder if custconf.pxml is where GUIs save its own configuration (about that specific application, of course)


CODE
<category>Alternate category
<subcategory>Alternate subcategory</subcategory>
</category>


Shouldn't be better this way?:

CODE
<category name='Alternate category'>
<subcategory>Alternate subcategory</subcategory>
</category>



It's mandatory to use subcategories on the GUI? The way my GUI is designed, it doesn't use subcategories, is possible to ignore them? Anyway, I can still change my GUI because code dealing with categories haven't been written yet, so no problem
 
Last edited by a moderator:
efegea said:
Yes, and also:
CODE
<category = 'Games'>

Is that correct XML? I've never seen nothing like that, shouldn't be <category name='Games'>? I don't know if it's possible to parse with Qt's XML module. I'll investigate..

No it's not valid. Either <category>Games</category> or <category name="Games">.

QUOTE

CODE
<category>Alternate category
<subcategory>Alternate subcategory</subcategory>
</category>

Shouldn't be better this way?:
CODE
<category name='Alternate category'>
<subcategory>Alternate subcategory</subcategory>
</category>
Both are valid XML. My personal preference would be to avoid mixed elements (i.e. your second example). Although your example is a bit asymetric. Why is name an attribute of a category, but not of a subcategory?
 
Last edited by a moderator:
Hey, don't yell at me! I don't know proper XML from PB&J. :p I copied everything directly from ED's PDF.

Aside from a couple spelling corrections and two hours worth of wiki code formatting, everything in the wiki version is identical to the PDF.


skeezix said:
Where is this linked _From_ in the wiki?

I think we need a Development Documentation page (in addition to the tools page) with links like this, the chip docs, etc. (Or maybe I'm missing it..)
It's linked on the Getting Started page (for lack of any better place) which is linked on the main page.

If you have any ideas for better organizing the info, have at it! :D
 
Last edited by a moderator:
Nice going with this ED, I always wished GP2X software were properly organized in such a manner. You'll need to make this stick with developers though, how will you do that?
 
I started looking through the spec and though I'd throw in a couple of comments. As it turns out, I actually have a few more than a couple ;-) I hope it's not interpreted as nit-picking, but I have some designed stuff like this in the past and know from experience (a) how important it is to get it right and (b) what the repercussions are if you don't...
  • Someone brought up the case of the extension already, which I think is a valid point. Same goes for the element and attribute names in the file itself. The use of upper case (e.g. <PXML>, eMail="...") may throw people off when all other tags are lower case.
  • The catlangs.pxml file is a bit of a misnomer in two ways. Firstly, it's not PXML as the standard describes, so why the extension? The name would suggest it's a list of "category languages", but it's not - why not just call it categories.xml?
  • I'm a bit fuzzy on what's mandatory and what's not as far as the <title> and <description> tags go. IMHO it should be valid to supply a "lang" attribute for all <title> elements, making the <title> without attributes optional.
  • Personally I'd get rid of the BB code - presentation doesn't belong in an XML document.
  • The use of the <standalone> tag escapes me. If parameters are required, won't they be specified in the associations?
  • I'd drop the <fooitem> tags in favour of multiple <foo> elements.
  • How about a "maintainer" element with the same attributes as <author>? Would be handy for those of us packaging software written by others.
  • The version/osversion tags: which attributes are mandatory? Personally I'd only require "major" to allow simple version checking without specifying superfluous attributes.
  • The description of the category element refers to a list of "default categories". What are these? It would be more flexible to refer to the file which defines the categories, instead of hard-coding them into the spec.
  • Should category by mandatory? Maybe there are things which belong in the "root"? Also, if someone misses out or misspells a category, it would would be nice if the icon appeared somewhere.
  • I'd replace the comma-separated "filetype" values with multiple filetype elements. It shouldn't be necessary to parse the file twice ;-)
  • An association's name is not multi-language - maybe it ought to be.
  • I'm not sure what <background>No</background> entails, but is it a good idea to make this the default behaviour? I'd have thought most apps should start in the background by default.
 
SteveM: Thank you very much for your very good ideas regarding the file :)
I've never designed an XML file before, so it's very appreciated.
Will update the file tonight :)
 
How would this work with Python programs? For instance the exec tag is mandatory, but Python programs don't actually have an executable. I guess the name of the main entry script would go there instead.
 
Eniko said:
How would this work with Python programs? For instance the exec tag is mandatory, but Python programs don't actually have an executable. I guess the name of the main entry script would go there instead.
It doesn't really matter if it's a script or not, it's an executable as soon as it has the 'x' (executable') bit set. It's unusual not to set the 'x' bit for scripts (which would just force you to always run it as e.g. 'python name-of-script.py'). So, in short, for Python (or Perl or sh etc) scripts the name should go into the <exec> tag, just as for any other application.

Edit: On the other hand: Why _is_ the exec tag mandatory? Couldn't there be packages which just install documents, for example? Or additional language packs? Or game data (other levels)? With the Debian package system you can even have packages that don't install a thing: They just have a small fix, for example, in the pre-install script, and the post-rm script removes the fix. E.g. there's one to update the Flash version number for the Maemo version of adobe flash, just to avoid problems with stupid web sites which checks the version.
 
Last edited by a moderator:
Caine said:
efegea said:
Yes, and also:
CODE
<category = 'Games'>

Is that correct XML? I've never seen nothing like that, shouldn't be <category name='Games'>? I don't know if it's possible to parse with Qt's XML module. I'll investigate..

No it's not valid. Either <category>Games</category> or <category name="Games">.

QUOTE

CODE
<category>Alternate category
<subcategory>Alternate subcategory</subcategory>
</category>

Shouldn't be better this way?:
CODE
<category name='Alternate category'>
<subcategory>Alternate subcategory</subcategory>
</category>
Both are valid XML. My personal preference would be to avoid mixed elements (i.e. your second example). Although your example is a bit asymetric. Why is name an attribute of a category, but not of a subcategory?


I prefer this one to the former one :)

<category>
<name>Alternate category</name>
<subcategory>Alternate subcategory</subcategory>
</category>

or
<category>
<name>Alternate category</name>
<subcategory>
<name>Alternate subcategory</name>
</subcategory>
</category>
 
Last edited by a moderator:
I don't like attributes inside tags at all (<category name='Alternate category'> for example) as it can make the file harder to parse under some conditions.
So i would prefer everything encapsulated in individual tags (<category><name> Alternate category</name></category>).

Also the inconsistency of mixing both seems ugly to me.
Again this can make parsing harder and is also less "user" friendly.
I would prefer either the one or the other not once encapsulated and once inside the tag.

edit: Beaten to it, anyway i would chose the first example of TiKub.

Also i would prefer all attributes/tags to be lowercase, less chance of problems

It would also be a good idea to specify the exact name AND case in the standard another possible cause for problems.
 
I'm confused why some elements are like this:
CODE
<version major='1' minor='1' release='1' build='2' />
<author name = 'EvilDragon' website='http://www.openpandora.org' />

whereas others are like this:
CODE
<standalone>Yes</standalone>
<icon>program.png</icon>
<exec>program.exe</exec>

etc.

Why not be more consistent through the file?
CODE

<?xml version="1.0" encoding="UTF8"
<PXML>
<title lang='en' text='Program title'/>
<title lang='de' text='Program Title in German Language'/>
<title lang='it' text='Program Title in Italian Language'/>
<standalone value='Yes'/>
<icon path='program.png'/>


etc. This also saves space, as I find it daft to duplicate every tag just for the need of closing it unless you need to have a large bulk of text (for example, description elements) or nesting of other tags (as below)

As for category/subcategory, I would prefer:
CODE

<category name='Alternate category'>
<subcategory name='Alternate subcategory'>
</subcategory>
</category>



Vimacs said:
I don't like attributes inside tags at all (<category name='Alternate category'> for example) as it can make the file harder to parse under some conditions.

We will be using a tried and tested XML library for PXML, so its guaranteed that the library can both generate valid XML and be able to parse valid XML. Writing your own file parser would therefore be strongly discouraged (incompatibility problems between software, etc)
 
Last edited by a moderator:
efegea said:
It's mandatory to use subcategories on the GUI? The way my GUI is designed, it doesn't use subcategories, is possible to ignore them? Anyway, I can still change my GUI because code dealing with categories haven't been written yet, so no problem
Just quoting myself.. if someone can answer my questing will be very appreciated :)
 
Last edited by a moderator:
hey

I'm no expert, and I should probably go over the XML specs, but I tend to think the attributes are for meta information, with the actual information bound by tags.

So it should be <title lang="en">Title Here</title>.

I hope this clears things up.

edit
Yep, quickly looked at http://www.w3schools.com/xml/xml_attributes.asp.

QUOTE
Attributes provide additional information about elements.

I guess this is obvious, hehe.

Anyhows later on it says:
QUOTE
There are no rules about when to use attributes and when to use elements. Attributes are handy in HTML. In XML my advice is to avoid them. Use elements instead.


Anyhows there is more information about why to avoid using attributes and such on that page also.

cyas
 
yosh64 said:
Anyhows there is more information about why to avoid using attributes and such on that page also.
I find it easier to make a DTD file from a XML file without attributes.
Then, you can not only check your PXML is a valid XML file but also that it conforms to PXML specifications :)
 
Last edited by a moderator:
Back
Top