2

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 &amp with &amp so I have to use the word 'and':

      <propertyregex property="prop"
           input="${prop}"
           regexp="&amp;"
           replace="and"
           override="true"
           global="true" />
Hedge
  • 16,142
  • 42
  • 141
  • 246

1 Answers1

3

Try either :
&amp;amp; which is parsed to &amp; which in turn results in &
or HTML Entity (decimal) &#38;
or HTML Entity (hex) &#x26;

Rebse
  • 10,307
  • 2
  • 38
  • 66