ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Fernandez <Alec.Fernan...@sas.com>
Subject RE: an input for ant arg.
Date Thu, 10 Jan 2008 12:58:23 GMT

Don't for get to use &quot; for the " char and &apos; for the ' char in your ant source
>> -----Original Message-----
>> From: Steve Loughran [mailto:stevel@apache.org]
>> Sent: Thursday, January 10, 2008 5:30 AM
>> To: Ant Users List
>> Subject: Re: an input for ant arg.
>>
>> Chun Ji wrote:
>>
>> >    <target name="migration">
>> >       <exec executable="java" dir=".">
>> >           <arg line="..."/>
>> >           <arg line="Test `grep "^where keyp_clientid in"
>> input.sql | awk '{print $4}'` "/>
>> >       </exec>
>> >       <xslt .../>
>> >    </target>
>> > ...
>> > "
>> > The error msg is: Element type "arg" must be followed by
>> either attribute specifications, ">" or "/>"
>> >
>> >
>> >
>> > So what should I do to solve this issue ? Any comments is welcome!
>> >
>>
>> The problem is the second <arg> statement has way too many
>> quotes in the line attribute for XML to handle. This an XML
>> problem, not an ant one.
>> You can use paired single quotes
>>
>>         line='some "inner" thing'
>> or double
>>         line="some 'other' thing"
>> but you cant have the same quotation type inside as out.
>>
>> Try creating the string from a couple of properties
>> <property name="grep" value='"^where keyp_clientid in"' />
>> ..and build these up
>>
>> of course, when you do that you'd find that the pipe,  the
>> grep and the awk wouldnt work, as they are shell commands.
>> You'd need to run bash.
>> Much better to
>>   -create at an outputredirector for the output
>>   -create a filterchain in the outputredirector that did your search
>>
>> -steve
>>
>> --
>> Steve Loughran
>> http://www.1060.org/blogxter/publish/5
>> Author: Ant in Action           http://antbook.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
>> additional commands, e-mail: user-help@ant.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message