<select-nodes query="//condition[@skill[(.=111440)]]/following-sibling::result[@special-2[(.=111440)]]/../..">
It selet <layer> nodes which has <condition skill="111440"> and <result special-2="111440">.
XML:
<layer>
<decision>
<condition skill="111440" skip-condition-move-check="y" skip-condition-target-check="y" />
<result control-mode="classic" special-2="111440" special-ui-effect="event" />
<result control-mode="bns" special-2="111440" special-ui-effect="event" />
</decision>
</layer>
<insert-sibling-after name="layer">
It insert <layer> nodes after selected <layer> nodes.
(it always insert AFTER SELECTERD NODES. so be careful your code's order.)
XML:
<layer>
<decision>
<condition skill="111440" skip-condition-move-check="y" skip-condition-target-check="y" />
<result control-mode="classic" special-2="111440" special-ui-effect="event" />
<result control-mode="bns" special-2="111440" special-ui-effect="event" />
</decision>
</layer>
<layer>
</layer>
<insert-sibling-before name="layer">
BEFORE works too.
<append-child name="decision">
It insert child-node named decision
XML:
<layer>
<decision>
<condition skill="111440" skip-condition-move-check="y" skip-condition-target-check="y" />
<result control-mode="classic" special-2="111440" special-ui-effect="event" />
<result control-mode="bns" special-2="111440" special-ui-effect="event" />
</decision>
</layer>
<layer>
<decision>
</decision>
</layer>
XML:
<insert-sibling-after name="layer">
<append-child name="decision">
<append-child name="condition">
<append-attribute name="skill" value="113615" />
</append-child>
<append-attribute> insert attribute to node.
XML:
<layer>
<decision>
<condition skill="111440" skip-condition-move-check="y" skip-condition-target-check="y" />
<result control-mode="classic" special-2="111440" special-ui-effect="event" />
<result control-mode="bns" special-2="111440" special-ui-effect="event" />
</decision>
</layer>
<layer>
<decision>
<condition skill=113615>
</decision>
</layer>
XML:
<select-nodes query="//condition[@skill[(.=113680)]]/following-sibling::result[@skillbar-8[(.=113680)]]">
<select-node query="@skillbar-8">
<set-name name="skillbar-2" />
<append-child name="key-status" value="unpress" />
</select-node>
</select-nodes>
If you need to change Attribute, remove "/../.." to select <condition> and <result> nodes.
<set-name> is command for change attribute's name. <set-value> is for value.(skill code or something comes after "=" mark)
XML:
<select-nodes query="//condition[@skill[(.=113698) or (.=113672)]]/following-sibling::result[@skillbar-5[(.=113698) or (.=113672)]]/../..">
<remove />
</select-nodes>
You can use "[ or ]" to change multi nodes.
<remove> will removes all seleted nodes.
XML:
<select-nodes query="//result[@stance[(.=113260)] and @skillbar-1[(.=113240)]]">
<select-node query="@context-2">
<set-value value="113400" />
</select-node>
<select-node query="@skillbar-2">
<set-value value="113640" />
</select-node>
</select-nodes>
You can use "[ and ]" to specify some nodes.
If you dont like <set>, <insert> or <append>, there are way to write direct code
XML:
<select-nodes query="/table/contextscript/stance[not(@link) and(@stance='뇌신' or @stance='연기공' or @stance='강기공')]">
<insert-sibling-after name="stance">
<append-buffer>
<![CDATA[
<layer>
<!-- my stuff -->
</layer>
]]>
</append-buffer>
</insert-sibling-after>
</select-nodes>
OR, load entire xml file.
XML:
<patch file="whatever.xml">
<load-file path="path\to\load.xml" />
</patch>
To check your code works or not, write <save-file> to last part of your code.
XML:
<patch file="whatever.xml">
<!-- do some patches -->
<save-file path="path\to\save.xml" /> <!-- can be either relative to current patch file or absolute -->
<!-- saves the current state of the document at the time save-file is executed -->
<!-- can be called multiple times to save to different files before/after applying different patches -->
</patch>
XPath online real-time tester, evaluator and generator for XML & HTML
This most user-friendly online tool enables you to interactively and secretly query XML/HTML documents using XPath 2.0. It can generate queries for you too!
You can use wildcard to code.
XML:
<patch file="skill3_contextscriptdata*.xml">
Atteched file is auto un-entangle ET boss 3.(made by LEaN's site)