Latest Entries
Feb 11

How to Escape {“‘<>&} Characters in ANT

How exactly do you escape special characters from ANT?  Say if you need to add extra ” quotation characters within a property which already has a set of quotes?

Here’s how to do it — use XML Character entity references:

For > use &gt;

For < use  &lt;

For use &quot;

For & use &amp;

For use &apos;
Any other characters you need?  Drop me a line..

3 Responses to “How to Escape {“‘<>&} Characters in ANT”

  1. Tolga Aglot said:

    Thanx for great article.

  2. Saumya said:

    How can we escape . (dot) in ant?

  3. raul said:

    Hello,

    Could you tell me how could I escape the ” and & characters in the properties files? I need to pass a string containing & to the command line and it constantly fails to work. If I echo the output and copy+paste in the command line manually it works but from the script it fails.

    Any help would be appreciated, I even tried replacing ” and & with unicode correspondent code and still no result :(

Leave a Reply


Related Topics:

No related posts.