I've got a property string (loaded from a file) containing the ampersand character in my ANT build-script.
How can I escape that string so I can write it to a xml-file using xmltask?
EDIT: The following code works but I can't replace & with & so I have to use the word 'and':
<propertyregex property="prop"
input="${prop}"
regexp="&"
replace="and"
override="true"
global="true" />
Try either :
&amp;
which is parsed to &
which in turn results in &
or HTML Entity (decimal) &
or HTML Entity (hex) &