Questions about the different XML tags

Barathor

Emperor
Joined
May 7, 2011
Messages
1,202
Here's what I understand so far, but I'm having a little trouble with some of them and what situation they're best utilized for.

<Row> "Insert"

This will attempt to insert the data into a new row. If there's data already present, it will cancel and do nothing and you're entire XML file containing it will also cancel.​

<Update> "Reinsert"

This will search for the row(s) and reinsert new data where specified.

If the tags within the <Where> do not exist, does it break or simply do nothing? I assume it just does nothing.

<Delete> "Extract"

This will search for the row(s) and extract all of its data.​

<InsertOrAbort> "Insert or Abort"

This will attempt to insert the data into a new row. If there's data already present, it aborts the attempt and continues with the rest of your XML file as normal.​

<Replace> "Insert or Reinsert" ?

So, this is like a <Row> and <Update> combined?


----------------------------------------------------------------------------------------------


Also, I know respacing things like this is fine if you want to improve readability:

Code:
[COLOR="DarkRed"]<Update>
	<Where Type="UNIT_WARRIOR"/>
	<Set Combat="9" Cost="45" Faith="90" Moves="3"/>
</Update>[/COLOR]

[COLOR="Navy"]<Update>
	<Where Type="UNIT_WARRIOR"/>
	<Set 
		Combat="9" 
		Cost="45" 
		Faith="90" 
		Moves="3"
	/>
</Update>[/COLOR]

And rewriting the code like this is fine (right?):

Code:
[COLOR="DarkRed"]<Delete TechType="TECH_SAILING" FlavorType="FLAVOR_WONDER"/>[/COLOR]

[COLOR="Navy"]<Delete>
	<TechType>TECH_SAILING</TechType>
	<FlavorType>FLAVOR_WONDER</FlavorType>
</Delete>[/COLOR]

Code:
[COLOR="DarkRed"]<Row Tag="TXT_KEY_UNIT_WARRIOR" Text="Warrior"/>[/COLOR]

[COLOR="Navy"]<Row>
	<Tag>TXT_KEY_UNIT_WARRIOR</Tag>
	<Text>Warrior</Text>
</Row>[/COLOR]

[COLOR="DarkGreen"]<Row Tag="TXT_KEY_UNIT_WARRIOR" >
	<Text>Warrior</Text>
</Row>[/COLOR]

But, out of curiosity, how would you write an update with the "single line" method? Are you forced to use <Update> and </Update> at each end? Or is there an even slicker method? :)

Code:
[COLOR="DarkRed"]<Update <Where Type="UNIT_WARRIOR"/> <Set Cost="45" Faith="90"/>/>[/COLOR]

^ I'm pretty sure that doesn't work.  But this is what I'm talking about.

[COLOR="Navy"]<Update>
	<Where>
		<Type>UNIT_WARRIOR</Type>
	</Where>
	<Set>
		<Cost>45</Cost>
		<Faith>90</Faith>
	</Set>
</Update>[/COLOR]

[COLOR="DarkGreen"]<Update>
	<Where Type="UNIT_WARRIOR"/>
	<Set Cost="45" Faith="90"/>
</Update>[/COLOR]
 
Back
Top Bottom