Hi, I have created dtd for most of the xml files of Wormux. A DTD file allows to check that an XML file is valid or not. Before we could only check that xml files are well-formed.
You can have more informations about dtd here : - in french: http://www.commentcamarche.net/xml/xmldtd.php3 - in english: http://www.thescarms.com/XML/DTDTutorial.asp A bad-formed xml is for example <person> <name>Gates</nmae> <firstname>Bill</firstname> </person> As you can see, the <name> element is misclosed probably due to type-mistake. Ok, in the past we check this sort of errors BUT we do not check that the element has sens for the code !! 1) It is well-formed and probably valid (need a DTD to be sure...) <animation speed=10 /> 2) It is well-formed but probably _NOT_ valid (need a DTD to be sure...) <animation speeed=10 /> This sort of errors could not be checked without DTD. So currently, I have written DTD for maps, teams, skins (not completed), graphism.xml, weapons.xml and authors.xml. There's game_mode/classic.xml left. For most of the xml, you can check it by running "rxp -Vsx file.xml". I have notice many inconsistency: - <author> section is not the same in maps and in skins - body.dtd is quite complicated and cannot be finished currently because data/body/*/config.xml CANNOT be valid!! The <member> section is not the same when it is a subelement of <clothe> and when it is a subelement of <frame>. Lodesi, could you fix the problem in the code and update the dtd ? - Still for bodies, it strange that member.cpp does not refers to <member> xml. - <sprite> ALWAYS contains an <image>. Why do not merge <sprite> and <image> ?? Now I will work on the game_mode/classic.xml and objects. It will ensure that we use the right parameter to setting the game and the weapons. It will be good to add the validation of xml in the compilation process, but I think it's crazy to add one dependency to "rxp" only to check the xml files. Of course, the dependency is only for developpers and not for users who install Wormux from packages. What do you think about it ? Bye, Matt PS: Sorry, have no time/no access before thursday to discuss about it on IRC. _______________________________________________ Wormux-dev mailing list [email protected] https://mail.gna.org/listinfo/wormux-dev
