489
edits
Script 10k (talk | contribs) |
Script 10k (talk | contribs) |
||
Line 141: | Line 141: | ||
===Description=== | ===Description=== | ||
This operation allows you to replace 1 XML value from existing XML elements. | |||
<tt>Usage: XmlTools --replace-value --current-val "currentValue" --new-val "newValue"</tt> | |||
===Example=== | ===Example=== | ||
Let's say you want to swap all the w1_tap weapons from characters to w8_mbo. | |||
'''XmlTools command:''' | |||
<pre>XmlTools --replace-value --current-val "w1_tap" --new-val "w8_mbo" --element-name "Weapon" --parent-element-name "OSD" --files "BINACJBOCharacter.xml"</pre> | |||
{| style="margin: 1em auto 1em auto;" <!-- Centers table --> | |||
! style="width: 50%;" | XML Original | |||
! style="width: 50%;" | XML After Command | |||
|- | |||
| | |||
<Oni> | |||
<Objects> | |||
<CHAR Id="7209"> | |||
<Header> | |||
<Flags /> | |||
<Position>434.9334 756 -231.2183</Position> | |||
<Rotation>0 258.058838 0</Rotation> | |||
</Header> | |||
<OSD> | |||
<Flags>NotInitiallyPresent</Flags> | |||
<Class>TCTF_lite_1</Class> | |||
<Name>l7</Name> | |||
<Weapon><span style="color:blue">w1_tap</span></Weapon> | |||
... | |||
</OSD> | |||
</CHAR> | |||
... | |||
</Objects> | |||
</Oni> | |||
| | |||
<Oni> | |||
<Objects> | |||
<CHAR Id="7209"> | |||
<Header> | |||
<Flags /> | |||
<Position>434.9334 756 -231.2183</Position> | |||
<Rotation>0 258.058838 0</Rotation> | |||
</Header> | |||
<OSD> | |||
<Flags>NotInitiallyPresent</Flags> | |||
<Class>TCTF_lite_1</Class> | |||
<Name>l7</Name> | |||
<Weapon><span style="color:red">w8_mbo</span></Weapon> | |||
... | |||
</OSD> | |||
</CHAR> | |||
... | |||
</Objects> | |||
</Oni> | |||
|} | |||
==--replace-all-values== | ==--replace-all-values== |
edits