ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: AW: Looping through a file contents
Date Thu, 19 Aug 2004 16:13:17 GMT
Dominique Devienne wrote:

>>From: Dominique Devienne []
>>4) Peter, did you put in more stringent rules on what
>>   can be used for the <ac:for>
>Let me finish that sentence ;-) For example purpose, I tried
>to use var="$_" in <ac:for>, and got the following error:
>...\foreach-line.xml:25: The following error occurred while
>                         executing this line:
>...\foreach-line.xml:13: Illegal name [$_] for attribute
>You can put pretty much everything you want in the name
>attribute of a <property>, so why being more restrictive
>in <ac:for>? What are the rules? Just wondering? --DD
The value of the "param" attribute are used as an attribute in the
embedded macro task in the <for> task. The macro does not know that
this will be used outside the context of an ant task and restricts the
value to those allowed for an XML attribute name.

So the following would not be allowed:
 <for param="$_" list="a,b,c">
      <echo>item is @{$_}</echo>

So the reason for the restriction is an accident of the
implementation (a.k.a a bug).


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

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

View raw message