RimWorld

RimWorld

231 ratings
Xml Patch Helper
3
4
6
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.3, 1.4, 1.5, 1.6
File Size
Posted
Updated
6.002 MB
21 May, 2022 @ 12:17am
18 Jun @ 10:24pm
7 Change Notes ( view )

Subscribe to download
Xml Patch Helper

Description
This tool allows you to validate or generate XPath based PatchOperations in-game so you can see exactly what your PatchOperation will look like and/or what the result will be.

After helping other modders in the RimWorld development discord channel for nearly 3 years, I figured it would be better to just provide a hands on tool that visualizes how patch operations work, as well as what your XPath is selecting.

The color for the Xml text is ugly!
You can change it in the mod settings.

Disclaimer: This is a modder tool, it has no impact on gameplay.

Github Release[github.com]

Check out my other mods!

I'm also making a game! So feel free to check it out if you like my mods.
[discord.gg]
78 Comments
Proxyer 19 Jun @ 3:35am 
YES! YES! Ty update!! Making patches just got easier!
Aria Victoria 18 Jun @ 11:18pm 
TY <3
Aria Victoria 18 Jun @ 7:39pm 
Oh, I guess the github link is old? Last update on the repo is showing as last year.
Smash Phil  [author] 18 Jun @ 7:33pm 
Oh yea sorry, this is already updated to 1.6 I just haven't pushed it to steam.
Aria Victoria 18 Jun @ 7:15pm 
No rush (As I know you're already super busy as it is), but, is there any chance of a 1.6 version? I've only been without it for a few days and am already looking at the mod page longingly.
cyanobot 21 Feb @ 9:04am 
Thank you for many diagnosed typos, invaluable tool.
Smash Phil  [author] 28 Sep, 2024 @ 5:38pm 
This isn't really set up to test those, but the concept would be the same as just trying to add that single <li/> node. The point is being able to quickly validate that your xpath is correct and that you're inserting the value exactly where you want it. Nested nodes or not, it would be the same.
123nick 28 Sep, 2024 @ 6:40am 
How do you test a patch that adds multiple layers of nodes to a node?

For example, when theres a weapon that has a "costList" field, and each node below it is <ResourceName>x</ResourceName>, where X is the count of resources, then its easy to just add one using the node and value fields this mod has

But if im trying to add an ingredient to a recipedef, to the <ingredient> node, each ingredient is layed out as such:
<li>
___<filter>
________<thingDefs>
__________________<li>ComponentSpacer</li>
________</thingDefs>
___</filter>
___<count>6</count>
</li>

How do i test a patch that adds the li node AND its child nodes to the ingredients node?
aikixd 10 Sep, 2024 @ 10:31pm 
Here's a larger samples with coloration removed:
<li></color>
<def></color>Spine</color><<i></i>/def></color>
<coverage></color>0.05</color><<i></i>/coverage></color>
<depth></color>Inside</color><<i></i>/depth></color>
<<i></i>/li></color>
aikixd 10 Sep, 2024 @ 10:30pm 
Yeah, it's a malformed tag. I'm no modder, but a sw dev. If you can point me, I can try to find the source. It seems that `<i></i>` it pushed after the tag opener on an ending tag. If you remove that, then the ending tag becomes correct: `</def>`. When I find-replace `<i></i>` -> ``, the document becomes well formed.