XML Patch add/replace
Closed this issue · 2 comments
I am using the XML Patch task. I noticed that both replace and add in xmlPatcher.ts call/fallback to each other in case the given element does exist / does not exist.
Given I have the following source XML:
<RedisCache> <Server Host="192.168.0.1" Port="6379"/> </RedisCache>
this seems to make it impossible for me to change it to:
<RedisCache> <Server Host="192.168.0.1" Port="6379"/> <Server Host="192.168.0.2" Port="6379"/> </RedisCache>
as the addition of the second Server element will always fallback to replace.
I'm afraid you are just running into one of the rough edges of this task. The support for arrays is not complete.
The fix will require the release of a new major version as it might be breaking for existing users.
Support for array is there and will be published with the 2.0