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 ". Carefully replace only those quote marks
that need to be passed along with this element name and it should work.

HTH
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
[EMAIL PROTECTED]
http://www.wilandra.com

-----Original Message-----
From: Oski Wee [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 09, 2005 6:21 AM
To: user@ant.apache.org
Subject: Quotations in a property get corrupted when passed as an arg

I am trying to read a property from my build.properties 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
process.

This is the property in build.properties:
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:
"AgentName:com.package.BookBuyerAgent("Some

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: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to