DTD/Schema upgrade??

jbryant

Prince
Joined
Jun 24, 2006
Messages
419
Location
State of Denial
My mod won't load up now, due to a proble with the UNITINFOS xml.

the reason is: element content is invalid according to DTD/schema

The unit in question does not have an upgrade, but apparently the game doesn't like that and won't load the file. Here is the offending code:

<bHiddenNationality>0</bHiddenNationality>
<bAlwaysHostile>0</bAlwaysHostile>
<UnitClassUpgrade>
<UnitClassUpgradeType></UnitClassUpgradeType>
<bUnitClassUpgrade>0</bUnitClassUpgrade>
</UnitClassUpgrade>

I originally had it blank, but got about the same error, except the game was angry over it being blank.


<bHiddenNationality>0</bHiddenNationality>
<bAlwaysHostile>0</bAlwaysHostile>
<UnitClassUpgrade>
</UnitClassUpgrade>


After this error i get another one:

Tag: UNIT_(everything) in Info class as incorrect
Current XML file is xml\Civilizations/CIV4Unit ArtStyleTypeInfos.xml

I haven't even opened this file! Not sure what's going on, but it leads to me having a mod with no units.
 
A unit not having an upgrade needs to be written like this:

<UnitClassUpgrades/>

(Also note that the above is upgrades with the s)

As opposed to the following that you used:

<UnitClassUpgrade>
</UnitClassUpgrade>

or

<UnitClassUpgrade>
<UnitClassUpgradeType></UnitClassUpgradeType>
<bUnitClassUpgrade>0</bUnitClassUpgrade>
</UnitClassUpgrade>
 
Thanks, I got it sorted out. Do you know what this DTD schema thing is?

Basically, just that. The XML looks for the tags in a specific order. If they are out of order or there is one that shouldn't be there it messes up.

So the schema said there should be (if the unit doesn't upgrade) the <UnitClassUpgrades/> and the one after that would be <UnitClassTargets/>. Instead in your XML if was finding <UnitClassUpgrade> (without the s) and then </UnitClassUpgrade>.

You can look at the schema file. It's in the same XML folder.
 
Back
Top Bottom