Pxml Fileformat V1.5
#1
Posted 01 March 2009 - 10:46 AM
PXML has changed slightly to be more easily read by his library, so I updated the specs.
For those who have no idea what PXML is:
It is basically a file which devs include within their games archive. The Pandora menu reads out that file and can automatically sort the game into the correct category, show descriptions or preview pictures and associate filetypes with. So basically, the user puts all his games onto the SD Card, inserts that into the Pandora, and the menu becomes automatically populated.
Download: PXML v1.5
#2
Posted 01 March 2009 - 11:23 AM
What icon resolutions are recommended? Is animated PNG supported by any chance?
Also, is there any list of categories that should be used?
This post has been edited by lulzfish: 01 March 2009 - 11:29 AM
#5
Posted 01 March 2009 - 12:07 PM
It bugs me alot that this standard isn''t valid XML.
Better said, these are the problems with the standard:
1. You use specific tags for language instead of "xml:lang". This means that the menu program needs to know ALL the ISO codes in the world and look for them just to translate the menu.
Proposal: Instead of "<description><de_DE>....", PLEASE use "<description xml:lang="de_DE">...."
2. You use numbers in tags so that they can change dynamically. Why is this a bad idea? I guess that most of you understand C; this is an example with the same problem:
loop3times {
printf("lol");
}
}
The 3 shouldn''t be part of the syntax, but a variable. Otherwise, the menu app has to look for "pic1", "pic2" etc. instead of just "all the "pic"s" and then sort them by nr.
Proposal: Instead of "<previewpic><pic1>...", use "<previewpics><pic nr="1">..."
3. You put things that should only exist ONCE in tags, so that it is possible to repeat them. What if the user adds many "<standalone>" tags, with different values? Values that should only be specified once, should only be allowed to do so.
Proposal: Instead of "<PXML><icon>...", use "<PXML icon="...">..."
4. You don''t use an XML namespace. This must be specified for valid XML. Just add a xmlns="" attribute to the PXML tag, with some random URL in it.
5. You use BBCode for formatting. Why? Consider, if you don''t want CSS, to use <i>-Tags etc. at least.
My proposition would be to set the standard to something like this:
<PXML xmlns="http://openpandora.org/namespaces/PXML" unique_id="123shaboo" standalone="yes" icon="hellollo.png" exec="/bin/bash -c ''echo hellollo''">
<title xml:lang="en_US">Hellollo</title>
<title xml:lang="de_DE">Hallollo</title>
<title xml:lang="sv_SE">Hejej</title>
<description xml:lang="en_US">This is a long description for the app. Why does it use [i]BBCode[/i]? Well, nothing is perfect, I guess. Look into CSS (the standard) some other time.</description>
<description xml:lang="de_DE">Dies ist eine längere Beschreibung für das Programm. Wieso verwendet sie [i]BBCode[/i]? Naja, nichts ist perfekt... Ihr solltet aber euch überlegen, vielleicht zu CSS herüberzugehen</description>
<description xml:lang="sv_SE">Detta är en längre beskrivning av programmet. Varför använder den [i]BBCode[/i]? Nåja, inget är väl perfekt... Ni borde dock överväga att byta till CSS</description>
<author name="dflemstr" website="a.bc.de" />
<version major="1" minor="1" release="1" build="2" />
<previewpic>
<pic nr="1">./lol.png</pic>
</previewpic>
<!--And so on, and so on...-->
</PXML>
PLEASE take this into consideration, since it will become VERY difficult otherwise to write launchers/menu apps for this format!!
EDIT: It is VERY difficult to fight vs these forum bugs!
This post has been edited by dflemstr: 01 March 2009 - 12:21 PM
#8
Posted 01 March 2009 - 04:23 PM
PLEASE take this into consideration, since it will become VERY difficult otherwise to write launchers/menu apps for this format!!
Why should it be difficult?
lib_pnd does all you need for reading in interpreting PXML already.
No need to code it yourself.
#9
Posted 01 March 2009 - 04:52 PM
3. You put things that should only exist ONCE in tags, so that it is possible to repeat them. What if the user
PLEASE take this into consideration, since it will become VERY difficult otherwise to write launchers/menu apps for this format!!
As for writing launchers/menu apps, all they have to do is call the routines in libpnd. Therefore they need not bother parsing any xml on there own - they simply ask libpnd to do all that work for them.
#10
Posted 01 March 2009 - 05:21 PM
According to the xml checker (http://www.cogsci.ed.ac.uk/~richard/xml-check.html), it is valid.
PLEASE take this into consideration, since it will become VERY difficult otherwise to write launchers/menu apps for this format!!
Why should it be difficult?
lib_pnd does all you need for reading in interpreting PXML already.
No need to code it yourself.
I can understand the point given by dflemstr :
- try to use attributes for an element instead of several terminal sub-elements when their orders don''''t care.
<element att1="1" att2="2" att3="3"/>
and
<element att3="3" att2="2" att1="1"/>
is strictly equivalent (their schema xsd would be the same) and attributes are easy to fetch from an element
<element><sub1>1</sub1><sub2>2</sub2><sub3>3</sub3></element>
and
<element><sub3>2</sub3><sub2>2</sub2><sub1>1</sub1></element>
is not strictly equivalent (their schema xsd would be different as their orders care) and accessing the texts of the sub-elements are trickier if you plan to read it serially.
- avoid to use elements tagged as "<tag-element_N/>" instead of "<tag-element rank="N"/>". Having <picX/> is UTTERLY stupid and make the code to fetch an element trickier. Best solution :
<pics> // pics only contains pic elements so counting its sub-elements gives pictures count
<pic/> // this one being the first
<pic/> // this one being the second
...
<pic/> // etc. of course you could also add an attribute like index="N" to make their index explicitly but it isn''''t necessary.
</pics>
considering <title/> :
<title>
<en>xxxx</en>
<fr>yyyy</fr>
<new iso>zzzz</new iso>
</title>
your xsd schema will be incomplete as it wouldn''''t know about a new ISO and reject it
where as :
<titles>
<title>xxxx</title> // no lang ==> en !
<title lang="fr">yyyy</title>
<title lang="new iso">zzzz</title>
</titles>
your xsd schema won''''t reject it.
This post has been edited by hlide: 01 March 2009 - 05:24 PM
#11
Posted 01 March 2009 - 06:52 PM
Why change something if it is already implemented and working?
I wish I would never post such stuff anymore, as with each thing posted, moaning starts again.
And as soon as we change it according to some other peoples wishes, moaning by some other guys starts again...
#14
Posted 01 March 2009 - 07:33 PM
I do not see what I said as moaning. I only tried to highlight problems that will happen, sooner or later, because the PXML format has alot of problems. (For example: What happens with multiple standalone tags? What if you want to associate the app with MIME types and not only extensions? How does the format handle encodings other than UTF-8 (for languages other than english)? etc) This rises alot of problems for a programmer, and for someone who would like to write a PXML file.
Most frameworks I have used so far comply to the XML standard. This makes it easy to make your own tools that support the format. Since the format is pure XML, you don''t need any extra tools except an XML reader/writer to change something in that file. Any editor/library/application that supports XML can thus open the file.
This isn''t possible with the current PXML file format. libxml won''t even open the example file, since it isn''t valid XML. Even if we have lib_pnd, what if I want to make an app in Java that writes PXML files for me? What if I want to make config files on my PC, and don''t want to compile an extra libpnd.so file that I have to carry around with me?
So, please, either continue with your current format and mark it as a proprietary format since only lib_pnd can access it consistantly (and you should therefore make the format proprietary to avoid parser errors), then also make bindings for all other languages that devs might use, make it cross-platform and with wchar_t support etc,
OR adjust the format so that you don''t need an extra library that you have to carry around just to open a file.
There''s nothing that''s "Almost XML". Either something is 100% XML compatible, or it is another format. It''s not even that difficult to make something XML compatible. Heck, to write a ''reader'' for a 100% valid XML format can be done in 5 min, with libraries like libxml or similar.
Ah, and BTW, for validating XML, you need a spec first, otherwise it''''''''s impossible to validate anything. The validator you, ED, linked to, doesn''''''''t take an XML spec (in XSD format) and can therefore not be a validator for XML. XML isn''t just a format, but a way to store data that needs a spec to work.
EDIT: The ONLY validator that is 100% compatible with the XML standard and officially supported by the World Wide Web (W3) group etc:
validator.w3.org
Without a DTD or a XSD file, this validator will recognise the file as XHTML 4.01 transitional, since thats the ONLY XML format that is allowed not to have a spec. Provide a XSD spec (that describes the format, like the provided PDF file but in "computer language"
This post has been edited by dflemstr: 01 March 2009 - 07:48 PM
#15
Posted 01 March 2009 - 08:32 PM
I just wanted to add, that if the only reason why the pandora team doesn''t create a format that is compatible with XML, is a lack of time, then why don''t others make it?
I could volunteer to not only make a format that is compatible across all platforms, fully XML compatible, with a XSD spec, and with a C \[s\]library\[/s\] function (no library needed) that can parse this file and give the result as a struct. Anyone else in the community could of course help with this.
We could even make it like this: The current PXML format continues to exist, until I release the new version (in max 3 days or so), and if I don''''t make it, I will stop complaining and just accept the current format.
What does everyone think about that?
This post has been edited by dflemstr: 01 March 2009 - 08:33 PM

Sign In
Register
Help
This topic is locked
MultiQuote