You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Loughran <st...@apache.org> on 2008/01/10 11:29:55 UTC
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
RE: an input for ant arg.
Posted by Alec Fernandez <Al...@sas.com>.
Don't for get to use " for the " char and ' 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