ant-user mailing list archives

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

>>From: Dominique Devienne [mailto:DDevienne@lgc.com]
>>
>>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:
>
>BUILD FAILED
>...\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">
   <sequential>
      <echo>item is @{$_}</echo>
   </seqential>
</for>

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

Peter

>---------------------------------------------------------------------
>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