by IBBoard at 27 Feb 2010, 20:53
Do we need anything else in the XML for a unit? I'm at a rather annoying point right now, having wasted a good chunk of the day on XML-related stuff.
Currently everything compiles and runs fine in Mono/MonoDevelop, but I've just tested it in Visual Studio and it seems it gets upset with the schemas. Basically, because we've got lots of optional tags and then a special "any" value in the schema then MS' .Net gets confused as to whether the XML element "race:unitAbilities" refers to the "race:unitAbilities" definition or the undefined "any".
It looks like this situation (which has quite an obvious solution - if it is specifically defined then use it) is fixed by the Xml Schema standard v1.1, but Microsoft are, of course, lagging on picking it up. The two alternatives are:
1) Go back to the ugly arbitrary "core:other" element to contain the "any" so that it doesn't get confused
2) Put something in just before the "any" that isn't optional
3) Pray for a miracle and hope that MS will back-port Xml Schema 1.1 to .Net 2.0 and later
It may be that I have to accept the use of (1) in some situations. I think I'll be dead before 3) happens, and 2) is possible but means that we a) need a non-optional element and b) break all existing data files.
Gah! So damned frustrating that development isn't going as fast as I want anyway and then the XML fights back >:(