Please Help (This is driving me crazy)

Made_of_sand

Chieftain
Joined
Aug 9, 2006
Messages
21
Location
Doncaster, England
quite New to mod, dingBeen working on something for a couple of days now (Just fiddling with the XML) It's a warlords conversion of the Ancient meditranean Mod, (i also want to add a few new civs but i'm still testing it at the moment)

And of course it doesn't load up! this isn't my first conversion mod, i managed to convert the Magyar Civ from CIV Gold into Warlords as a test for this one, that worked okay

The problem is that i get an error message whenever i try and load it up saying

XML Load Error
Failed Loading xml file XML\Gameinfo/Civ4erainfo.xml
[.\fxml.cpp:133] Error parsing file
File: xml\gameinfo/Civ4erainfos.xml
Reason: invalid at the top level of the document
Line 1:1
Source <?xml version="1.0"?>

there dpoesn't appear to be any problem with the top of the document, i've been changing stuff looking everywhere for the problem, but i can't find it, can anyone help?
 
Made_of_sand said:
The problem is that i get an error message whenever i try and load it up saying

XML Load Error
Failed Loading xml file XML\Gameinfo/Civ4erainfo.xml
[.\fxml.cpp:133] Error parsing file
File: xml\gameinfo/Civ4erainfos.xml
Reason: invalid at the top level of the document
Line 1:1
Source <?xml version="1.0"?>

there dpoesn't appear to be any problem with the top of the document, i've been changing stuff looking everywhere for the problem, but i can't find it, can anyone help?

That looks fishy.
 
Could you rename your "CIV4EraInfos.xml" file to "CIV4EraInfos.txt" and attach it to a reply?
 
@Made_of_sand

This has happened to me previously. Usually it is caused by 2 or 3 hidden characters at the very beginning of the xml file. I don't know how they get there but I can usually fix it by the following:

1. Backup the xml file first in case of an error.

2. Open the xml file in MS Word and you should be able to see the hidden characters.

3. Delete the extra characters at the beginning of the document

4. Save as a text file on your hard drive.

5. Delete the original xml file and then rename the new text file as the xml file you just deleted.

I've had this error 2 or 3 times and this has always fixed it. Hope it works for you.

[EDIT]
I looked at your text file in post#5 and did not find an error like I described but instead a different error on line 181:
Code:
        <EraInfo>
            <Type>ERA_IMPERIAL</Type>
            <Description>TXT_KEY_ERA_IMPERIAL</Description>
            <Strategy>TXT_KEY_ERA_IMPERIAL_STRATEGY</Strategy>
            <bNoGoodies>1</bNoGoodies>
            <bNoAnimals>1</bNoAnimals>
            <bNoBarbUnits>1</bNoBarbUnits>
            <bNoBarbCities>0</bNoBarbCities>
            <iStartingUnitMultiplier>2</iStartingUnitMultiplier>
            <iStartingDefenseUnits>2</iStartingDefenseUnits>
           [B] iStartingWorkerUnits>1</iStartingWorkerUnits>[/B]
            <iStartingExploreUnits>1</iStartingExploreUnits>
See the bolded line. It has an invalid character in the place of "<"
 
Also there are some strange characters in one of the comments at the top of the file:

Code:
<!-- edited with XMLSpy v2006 U (http://www.altova.com) by Knut &#1388;genp&#65533;r (Knutsoft) -->

Maybe these are what caused the XML load error.
 
i've got the same errors some weeks ago and figured out that i saved the file with UTF-8 coding instead of ANSI.
then i tried around with the codings aviable in notepad (utf-8, ansi, unicode and unicode big endian) and figured out that only the ANSI coding works. i haven't changed anything in the text, just saved it with the ansi-coding.

hope that helps :)
 
So i tried Amra's method, pleased to say that it worked, thanks a lot for that, and i'm really looking forwards to your big Mod's next upgrade.

Now that that is over i can start to sort out the rest of the error messages, i've still got a bit more to go.
 
Back
Top Bottom