When usingt setValue() for replacing a variable ${variable} containing "&" the function does not respond with any error but the document will be saved corrupted and therefore you will not be able to use or open it.
Our Solution was to replace the "&" with the xml code for that character, so'&' and then it will be correctly replaced.
When usingt setValue() for replacing a variable ${variable} containing "&" the function does not respond with any error but the document will be saved corrupted and therefore you will not be able to use or open it.
Our Solution was to replace the "&" with the xml code for that character, so'&' and then it will be correctly replaced.
I hope that might help!