PXML.xml Spec Changes - Versions


milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,746
Age
38
Location
Rotherham, UK
the only thing im worried about is being able to compare to version with each other if they ara string, does anyone have any good php tricks to do this?

@Ivanovic could you please update the wiki because the pastebin you provided seems rather complex (i must be stupid lol).
 

ivanovic

Member
Joined
Aug 4, 2006
Messages
784
milkshake said:
the only thing im worried about is being able to compare to version with each other if they ara string, does anyone have any good php tricks to do this?

@ivanovic could you please update the wiki because the pastebin you provided seems rather complex (i must be stupid lol).
The specs themselves are still the same, old PXML.xml files are still valid. The *ONLY* change in the specification itself is that not only plain numbers are allowed, but also letters (a-z and A-Z) as well as the chars plus ('+') and minus ('-') in addition to the numbers 0-9. There is *no* limit regarding the size of the content in those fields.

Regarding how to compare stuff: IIRC most langs are quite able to do string comparison and should evaluate correctly (meaning '39ff' being evaluated as larger than '39' when directly comparing). In general you can assume that the numbers between version will only change little (hey, the packages do come from the same people!).

In general please do not mix up two things:
1) The spec change for the version number.
2) The stricter requirements for having a PXML.xml evaluated as "correct" following the schema definition. Those should be irrelevant for you as user of PXML.xml files. It is only required to adjust those if the author wants to be able to use the automatic evaluation of the PXML.xml file.
 
Last edited by a moderator:

milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,746
Age
38
Location
Rotherham, UK
well I was going to use DOM to validate the XML before I stripped data from it.

i.e.

Code:
libxml_use_internal_errors(true)
$dom = new DomDocument();
$dom->load("PXML.xml");
$dom->schemaValidate('your_updated_schema.xsd');

the above code would return true or false depending on wether the given PXML.xml valid according to the schema.

if it is valid then I would stripp needed data from the PXML.
if nor valid return erros using libxml_get_errors and display_xml_error to fetch and display the errors.

so will this work with your updated schema?
 

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,063
Website
www.codejedi.com
RL is being very busy for me of late, so I'm just playing catch up .. but I've been beting it over in IRC a lot with Ivanovic, and i'm following the chateer.. just no time to post much :(

(I'm carrying two pagers and doing production issues 24-7 the last couple weeks it seems :)

jeff
 

milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,746
Age
38
Location
Rotherham, UK
from my little test using ur new schema the order in which the PXML spec is laid out does not match the wiki order.


sample xml
Code:
<PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">

	<application id="gforce">

		<title lang="en_US">Gravity Force</title>
		<title lang="de_DE">Schwere Kraft</title>
	 
		<exec command="gforce.sh"/>
	 
		<description lang="en_US">Remake of Amiga game Gravity Force</description>
		<description lang="de_DE">de_DE Automatisch generiertes pxml aus/media/MAINSYSTEM/source/zx_sdl/built exe=zx_sdl</description>
	 
		<previewpics>
		</previewpics>
	 
		<author name="David Douglas" website="http://www.openpandora.org"/><!--Optional email and website, name required-->
	 
		<version major="1" minor="1" release="1" build="1"/><!--This programs version-->
		<osversion major="1" minor="0" release="0" build="0"/><!--The minimum OS version required-->
	 
		<categories>
			<category name="Game">
				<subcategory name="ActionGame"/>
			</category>
		</categories>
 
	</application>

</PXML>

that was invalid so I arranged and tested it untill it finally validated the xml in this order...

Code:
<PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">

	<application id="gforce">

		<exec command="gforce.sh"/>
		
		<title lang="en_US">Gravity Force</title>
		<title lang="de_DE">Schwere Kraft</title>
 
 		<author name="David Douglas" website="http://www.openpandora.org"/><!--Optional email and website, name required-->
 
 		<version major="1" minor="1" release="1" build="1"/><!--This programs version-->
		<osversion major="1" minor="0" release="0" build="0"/><!--The minimum OS version required-->
 
		<description lang="en_US">Remake of Amiga game Gravity Force</description>
		<description lang="de_DE">de_DE Automatisch generiertes pxml aus/media/MAINSYSTEM/source/zx_sdl/built exe=zx_sdl</description>
	 
		<previewpics>
		</previewpics>
	 
		<categories>
			<category name="Game">
				<subcategory name="ActionGame"/>
			</category>
		</categories>
 
	</application>

</PXML>
 

ivanovic

Member
Joined
Aug 4, 2006
Messages
784
I just updated the specs wiki page (and made the completely outdated PXML page a redirect to the specs page). Now it should be in correct order and I added something to the validation area regarding how to validate. Besides I also worked on integrating the validation in the pnd_make.sh script.

In general you should *not* assume that every PXML.xml file that is accepted by libpnd will also pass validation. Validation is by far stricter than libpnd itself will ever be! But everything that passes validation is *extremely* likely to work in libpnd afterwards (there might be some obscure corner cases that are not working, but those should be really seldom).
 
Top