Clearing Up Some Misconceptions ...related to the PXML format
#1
Posted 24 November 2009 - 08:39 PM
I've taken a look around at various implementations of PND-related software, and they all seem to have one thing in common: their PXML (a file type related to the PND format) file parsing is really buggy, and/or they provide a faulty PXML file.
So in order to prevent a PND compatibility hell once the Pandora is released, I beg all developers who plan on ever touching something PND-related: Read the PXML specification. It will do you good, I promise.
Now, I know that things related to this specification have been messy before (and I still see EvilDragon's version of it lurking in the file archive!) but I'm telling you: this is the real deal, this is the spec you're supposed to follow.
I hope that this post will have some effect; that I won't see "gameemulator" as a category or "*.myfile" as a "file association". There's no way that a launcher will be able to pick up your PXML file if you don't follow the spec, and if a launcher itself doesn't follow the spec... chaos.
I've cleaned up the specification a little over the last few days, to make it easier to understand, and I will continue to do so in the future. Nothing will be added/removed though.
It also seems like skeezix has added some extensions to the PXML format that are undocumented, but us mortals shouldn't have to care about those yet so I won't add them to the specification.
All clear? OK, dismissed ;)
#2
Posted 24 November 2009 - 11:36 PM
I haven't searched to find if such an undertaking is already being made, it seems like a sensible addition to a Pandora package repository.
#3
Posted 25 November 2009 - 01:12 AM
Quote
Regarding non compliant launchers, maybe they could go through an "app approval" process before going up on the archive? (ED has to manually approve all archive submissions anyway, so it would just be an extra step).
#4
Posted 25 November 2009 - 03:25 AM
I have included stubs and stubtools to validate apps, though mostly those don't check too closely as we've chased a moving target, but ever-tightening is good. Thanks dflem for the spec rewrite and parser redo.. Only a few additions and fixes have been done, though we're forever tweaking here or there. I'll do a few updates to the wiki soon.. Figured the wiki would be the best place to publish and attempt to keep up t date
I'll write more tomorow.. Typing on a phone is hell :)
jeff
#5
Posted 25 November 2009 - 03:34 AM
We should make a good xsd validator..
Vimacs did include a sh script that emits properly formed default blank pxml's including useful semirandom uniqueids, as well, for during the build process for unixheads
Jeffphone
#6
Posted 25 November 2009 - 08:57 AM
I made a start, damned if anyone else is doing it but it's not going to do any harm if I use it as an excuse for a bit of out-of-hours PHP honing.
#7
Posted 25 November 2009 - 09:19 AM
Either its a standard, normal, documented feature, or its out.
#8
Posted 25 November 2009 - 09:25 AM
WoD, on 25 November 2009 - 09:57 AM, said:
I made a start, damned if anyone else is doing it but it's not going to do any harm if I use it as an excuse for a bit of out-of-hours PHP honing.
I started a similar Projekt some month ago, but discontinued because the specification was really unclear to me.
On the new Wiki site I read something about a XML schema. Where can I find that schema?
This post has been edited by Guy Montag: 25 November 2009 - 09:25 AM
#9
Posted 25 November 2009 - 09:43 AM
So:
- team make a "PXML Signer" app - just a simple command line tool that takes a PXML file, does rigorous validation, and adds the hash on the end if it's happy. This could easily be integrated into the build process for any dev, so wouldn't be anything to worry about
- team add a "validate" function to the pnd library - this simply loads the pxml, regenerates the hash, and compares it with the one in the file. If it's missing, or doesn't match, the file is ignored.
#10
Posted 25 November 2009 - 12:36 PM
There are some things that cannot be easily validated, like for example the mime-type for file associations, the "command line args" associated with those associations, the "category" part etc.
And Skeezix; libpnd just parses the text of a PXML, it doesn't check it's validity; e.g. "pnd_pxml_get_standalone" returns "char *" and not true/false, and "pnd_pxml_get_clockspeed" doesn't return an uint32 etc. And if we want it to be a true combinatoric parsing library, we'd maybe want to return a "char *" containing PNG bytes instead of a file path from "pnd_pxml_get_previewpic#" (or if not, at least a function that returns an array of paths would be in order, but we've talked about this before).
So libpnd doesn't really improve the standardization situation; it only fixates the XML format in a way, but nothing more. This leads to e.g. a bug in pmenu ("main.c:125"):
if((strcasecmp(d -> main_category, "emulators") == 0) | (strcasecmp(d -> main_category, "emulator") == 0))
{
tmpSection = EMULATORS;
}
else if((strcasecmp(d -> main_category, "games") == 0) | (strcasecmp(d -> main_category, "game") == 0))
{
tmpSection = GAMES;
}
else if((strcasecmp(d -> main_category, "applications") == 0) | (strcasecmp(d -> main_category, "application") == 0))
{
tmpSection = APPLICATIONS;
}(Please note that none of {emulator, emulators, games, applications, application} are valid categories according to the spec ("Game" IS valid, but that's coincidental in this case), so PNDs that DO follow the spec won't even show up correctly in pmenu.)
EDIT:
Guy Montag, on 25 November 2009 - 10:25 AM, said:
You can't. The old schema seems to have been screwed up as it got committed into the pandora-libraries repository (It uses UTF-16 encoding I believe) so it's broken, and it's out of date by now anyways. I thinkt hat producing a new schema would be in order.
benjymous, on 25 November 2009 - 10:43 AM, said:
It would be as easy to integrate a validator into libpnd, so that no validation process would have to occur.
This post has been edited by dflemstr: 25 November 2009 - 12:58 PM
#11
Posted 25 November 2009 - 06:06 PM
Just want to once again make sure you understand that I really like PND, I just am all too familiar about the lazyness levels of people! :)
Steve
#12
Posted 25 November 2009 - 06:12 PM
So what I'll do next is that I'll develop a simple tool, that will check a PXML file and tell the user exactly what's wrong with it. E.g. "You're missing an icon element" or "That language code doesn't exist" and so on. Do you think that people would use something like that?
#13
Posted 25 November 2009 - 08:30 PM
Get it while it's hot.
Example output:
#14
Posted 25 November 2009 - 10:46 PM
dflemstr, on 25 November 2009 - 06:12 PM, said:
So what I'll do next is that I'll develop a simple tool, that will check a PXML file and tell the user exactly what's wrong with it. E.g. "You're missing an icon element" or "That language code doesn't exist" and so on. Do you think that people would use something like that?
If the user runs a script to make the PND package, and your tool is run as part of that process, then they wouldn't have much choice but fix the problems - unless they don't use any scripts to create the PND and do it manually. The tool output looks good to me by the way!

Sign In
Register
Help

MultiQuote