WIX – edit xml file with the help of xpath notation

We can apply changes to an xml file, we can use the xmlfile element which is part of the Util Extension:


You can find all my latest posts on medium.

The following copies the file across and makes a change to an element’s value:

Note: It singles out en element that has an attribute called “name”, and has value “connection.connection_string”.

Note: The “[\[]” is an escaped opening square bracket, also “[\]]” is an escaped closing square bracket. That’s because in wix, square brackets have a special meaning, i.e. it indicates a variable. However we are using the square brackets as part of xpath notation, that’s why they needed to be escaped.