489
edits
Script 10k (talk | contribs) (first draft of a new documentation page for XmlTools) |
Script 10k (talk | contribs) |
||
Line 17: | Line 17: | ||
===Description=== | ===Description=== | ||
This operation allows you to add new XML values to existing XML elements. The values should be space separated and contained within quotes. | |||
Usage: | |||
<tt>XmlTools --add-values --new-val "new values"</tt> | |||
===Examples=== | ===Examples=== | ||
Let's say you want to add the Unkillable and the NonCombatant flag to A_L18 character. | |||
XmlTools command: | |||
<pre>XmlTools --add-values --new-val "Unkillable NonCombatant" --xpath-expression "/Oni/Objects/CHAR[@Id='3926']/OSD/Flags" --files "BINACJBOCharacter.xml"</pre> | |||
Original: | |||
<Oni> | |||
<Objects> | |||
<CHAR Id="3926"> | |||
<Header> | |||
<Flags /> | |||
<Position>-37.3426628 756 -491.6369</Position> | |||
<Rotation>0 221.15564 0</Rotation> | |||
</Header> | |||
<OSD> | |||
<Flags>NotInitiallyPresent</Flags> | |||
<Class>TCTF_lite_1</Class> | |||
<Name>A_L18</Name> | |||
<Weapon>w8_mbo w1_tap</Weapon> | |||
... | |||
</OSD> | |||
</CHAR> | |||
... | |||
</Objects> | |||
</Oni> | |||
Modified: | |||
<Oni> | |||
<Objects> | |||
<CHAR Id="3926"> | |||
<Header> | |||
<Flags /> | |||
<Position>-37.3426628 756 -491.6369</Position> | |||
<Rotation>0 221.15564 0</Rotation> | |||
</Header> | |||
<OSD> | |||
<Flags>NotInitiallyPresent <span style="color:red">Unkillable NonCombatant</span></Flags> | |||
<Class>TCTF_lite_1</Class> | |||
<Name>A_L18</Name> | |||
<Weapon>w8_mbo w1_tap</Weapon> | |||
... | |||
</OSD> | |||
</CHAR> | |||
... | |||
</Objects> | |||
</Oni> | |||
==--remove-values== | ==--remove-values== |
edits