Patch another module's object (XSLT)
xslt_patchPatch vanilla or mod objects by adding module XSLT rules that change attributes, nodes, or child XML without copying files. Preview before/after diffs; repeated calls merge.
Instructions
Changes an object owned by vanilla or another mod without copying it, by adding a rule to your module's XSLT (ModuleData/XSLT/_.xslt, registered automatically — the same mechanism the official DLC uses). One call per target node; repeated calls merge. Operations: set attributes, remove attributes, remove the node, replace it, append child XML, or clear the rule. Shows a before/after diff computed with the game's XSLT engine.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| set | No | Attributes to set/add, e.g. {"weight": "1.5"}. Values are strings. | |
| path | No | Optional nested element inside the target (mini XPath), e.g. ItemComponent/Weapon or skills/skill[@id='Bow']. | |
| clear | No | Remove this module's existing rule for the target instead. | |
| force | No | Overwrite a hand-written rule with the same match. | |
| module | Yes | Your writable module. | |
| remove | No | Delete the target node entirely. | |
| target | Yes | Object to patch: Item.x, NPCCharacter.x, Culture.empire, Settlement.town_EN1, Faction.clan_x, … | |
| preview | No | Show the before/after diff (default true). | |
| game_type | No | Game type used for the preview (default Campaign). | |
| append_xml | No | Append this XML as child element(s) of the target node. | |
| replace_xml | No | Replace the target node with this XML. | |
| remove_attributes | No | Attribute names to delete. |