this is for example also a valid single node opening:
Code: Select all
<do_if
value="some really long expression you better
split into multiple lines to avoid annoying
horizontal scrolling"
chance="another really long expression you better
split into multiple lines to avoid annoying
horizontal scrolling which resolves to 0 or 100"
/>
1. the ws attribute is for removing whitespaces so you can keep the xml indents in the result document, i dont think it can be used to remove multiple nodes at once. same for replace - each adressed node must be unique.
there is an unofficial msel extension which allows the adressing of multiple nodes in one operation, but its afaik not supported by EGO yet.
2. yes, otherwise your xml is not valid. note that you would also replace the actions inside this <do_if/> since you adress the whole Node, not just the Line where it starts.
you can replace the attribute values themselves though:
Code: Select all
<replace sel="//*****/do_if[@value='not $Ship.buildmodule and $Ship.primarypurpose != objectpurpose.mine']/@value">( not $Ship.buildmodule and $Ship.primarypurpose != objectpurpose.mine ) or $someothercondition</replace>
alternatively you could also add a chance attribute as further restriction if you just want the do_if to apply in less cases:
Code: Select all
<add sel="//*****/do_if[@value='not $Ship.buildmodule and $Ship.primarypurpose != objectpurpose.mine']" type="@chance">$someothercondition * 100</add>