ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Rich" <>
Subject RE: Quotations in a property get corrupted when passed as an arg
Date Sat, 09 Apr 2005 15:52:55 GMT
An Ant file is an XML file, therefore, you need to use the XML element for
quote marks if you want the real quote mark to appear in the target. The XML
element for quote mark is &quot;. Carefully replace only those quote marks
that need to be passed along with this element name and it should work.

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716

-----Original Message-----
From: Oski Wee [] 
Sent: Saturday, April 09, 2005 6:21 AM
Subject: Quotations in a property get corrupted when passed as an arg

I am trying to read a property from my file and pass it as
an <arg> to a script that I <exec>.  The problem is that the property value
contains literal quotation marks inside, and they get corrupted during the

This is the property in
jade.arg=AgentName:com.package.BookBuyerAgent("Some Book Title")

This is a snippet in build.xml:
<echo message="${jade.arg}" />
<exec executable="${jade.script}" spawn="true" dir="${build.dir} "> <arg
value="${jade.arg}"/> </exec>

The arg echoed in Ant just fine:
     [echo] AgentName:com.package.BookBuyerAgent("Some Book Title")

But then, in the script (which is a Windows .cmd file), the first line
echoes the very same arg:
echo %1

And instead of the expected, I get:

There is an extra space and quotation in front.  This is not too bad, as I
can work around that with some processing my script; or, if possible, in
Ant, even?.

But the main problem is the missing chunk at the end.  What happened to the
rest of the value, ' Book Title")' ?

Any ideas, suggestions appreciated.

To unsubscribe, e-mail: For additional
commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message