C2C - mass XML changes parser

Nimek

Emperor
Joined
Jul 7, 2010
Messages
1,208
This is development thread for mass XML changer that I and TB now work on.

It will allow us to simply mass add/edit tags to existing units( and in future to buildings) that fits to defined categories.
 
This is development thread for mass XML changer that I and TB now work on.

It will allow us to simply mass add/edit tags to existing units( and in future to buildings) that fits to defined categories.

STRONG recommendation:

Do NOT be dependent on ordering of columns in the CSV. Use a header column containing tag names (or other field identifiers as you see fit) to bind the column values to XML values. Otherwise whenever the schema changes you're going to need to change not only the parser (which might be hard to avoid unless you also parse the schema) but also all the CSV data you have already set up.

Edit - this is an example of the phrase 'You can solve every problem with another level of indirection, except for the problem of too many levels of indirection' ;)
 
@Koshling

I plan to do it that way. Header column name will be tag name in XML file. So dont worry I plan to make this parser as useful as possible.
 
Just a reminder that since we use the WoC standard that modules may contain minimum XML. For example the XML for a building in a module may contain 3 tags the BuildingClass and Type tags plus the tag of the value being changed.
 
Just a reminder that since we use the WoC standard that modules may contain minimum XML. For example the XML for a building in a module may contain 3 tags the BuildingClass and Type tags plus the tag of the value being changed.

This is true, BUT i would like it better IF "we" ever move stuff to the CORE, then its better to have stuff "always" consistent with the core, no offense to the WoC stuff. But if its regular core stuff in the modules it really doesnt matter, does it? Infact it might help out alot more also, maybe IMPO.
 
Just a reminder that since we use the WoC standard that modules may contain minimum XML. For example the XML for a building in a module may contain 3 tags the BuildingClass and Type tags plus the tag of the value being changed.

Wow, I didn't know that.
 
This is true, BUT i would like it better IF "we" ever move stuff to the CORE, then its better to have stuff "always" consistent with the core, no offense to the WoC stuff. But if its regular core stuff in the modules it really doesnt matter, does it? Infact it might help out alot more also, maybe IMPO.

I don't agree. If you have all the tags in there it is difficult to see what is changed. Also having all the null tags in the core files slows down the initial loading into cache.

One thing that we could perhaps improve is for the pedia to get its information from the cache. It is very slow at the moment. Or maybe we need to have a pedia cache.
 
Also having all the null tags in the core files slows down the initial loading into cache.
Well... imo this is something we should clean up anyhow.
 
I don't agree. If you have all the tags in there it is difficult to see what is changed. Also having all the null tags in the core files slows down the initial loading into cache.

One thing that we could perhaps improve is for the pedia to get its information from the cache. It is very slow at the moment. Or maybe we need to have a pedia cache.

Its either have some dll work done, OR do what MaxRiga did, and place everything in the modules folders. That way we could go through all the files and get rid of the NONE's and stuff like that??
 
I develop this parser to support XML combat mod work but if you need to clean up buildings tags at the first place. Please let me know.

I think that i will take a While before TB add all subcomkbat classes to all units and its new values like rel, knoback etc.

@TB

NOw subcombat structure looks like this
<subCombatTypes>
<subcombatType>value</subcombatTYpe>
<subcombatType>value</subcombatTYpe>
</subCombatTypes>

Maybe something like that will be more accurate from programmer perspective.
<Combat>Primary combat value here<Combat> (combatants, hunters, explorers, spy, civilian etc)
<subCombatTypes>
<speed>value</speed>
<motility>value</motility>
.....
</subCombatTypes>

I can simple do what you want with parser
 
I develop this parser to support XML combat mod work but if you need to clean up buildings tags at the first place. Please let me know.

I think that i will take a While before TB add all subcomkbat classes to all units and its new values like rel, knoback etc.

@TB

NOw subcombat structure looks like this
<subCombatTypes>
<subcombatType>value</subcombatTYpe>
<subcombatType>value</subcombatTYpe>
</subCombatTypes>

Maybe something like that will be more accurate from programmer perspective.
<Combat>Primary combat value here<Combat> (combatants, hunters, explorers, spy, civilian etc)
<subCombatTypes>
<speed>value</speed>
<motility>value</motility>
.....
</subCombatTypes>

I can simple do what you want with parser

Ah... that formatting wouldn't work too well (pretty much it won't work at all) when it comes to the loading process in the dll. The nested xml declarations can't be arbitrary with this tag. Might be better to have a second (and possibly third) row across the top to declare nested tag terminology for the app.
 
Ok

Here you have my XML Reader

http://seoexperts.pl/civ4/


Now it reads CivUnits xml file. Next step is allowing to upload own xml file
 
@SO
After you select Combat Type parser take first matched unit and maks label array from it. So tags are liste in order as it is in XML file.

Quick looks up on siege units shows taht capture tag should be updated for ex FAlconet because after capture it changes to canon !!!
http://seoexperts.pl/civ4/?Combat=UNITCOMBAT_SIEGE
 
@SO
After you select Combat Type parser take first matched unit and makes label array from it. So tags are listed in order as it is in XML file.

Sorry i am not good at this type of stuff, i really dont understand what you mean:blush:
 
If you want any tags to be listed first please give me correct order as you want. I can force it.

Note hydro about this reader. It is very useful in finding bugs.
 
If you want any tags to be listed first please give me correct order as you want. I can force it.

Note hydro about this reader. It is very useful in finding bugs.

Not right now, do what you are doing, because i really have no idea what the heck you are doing sorry.:(
 
I can't see any .xsd files. Is the format of XMLs stored in some other way?

Btw, wouldn't be easier to just use XML transformations? For our needs Xalan would be probably more then enough.
 
I can't see any .xsd files. Is the format of XMLs stored in some other way?

Btw, wouldn't be easier to just use XML transformations? For our needs Xalan would be probably more then enough.

The schemas are named <prefix>schema.xml and are in the same folders as the XML files they act as schemas for
 
The schemas are named <prefix>schema.xml and are in the same folders as the XML files they act as schemas for
Sorry for lazy-assing. :p

Still, can you say something about using XSLT here? I never used it for something more then toying, but it looks like a proper tool for changing multiple values at once and could be useful for easy reformatting.

(I think Thunderbrd would have a great occasion to learn C++, also. :D)
 
Top Bottom