[OFBiz] Dev - looping in simple-xml

David E. Jones jonesde at ofbiz.org
Mon Jul 18 16:27:00 EDT 2005


Yeah, that is an ugly way to do it....

What is it that this is being used for? I mean, what is the code  
inside the loop doing or what is it that the index is being used to  
look up?

This question has come up before, but usually a numeric index loop  
isn't the best solution anyway. If needed a new operation could  
certainly be added...

This code snippet below looks like it is being used to create a  
sequenced ID, though with other code left out I can't tell. The usual  
solution is to use something like make-next-seq-id which does sub- 
sequence ID generation.

-David


On Jul 18, 2005, at 11:36 AM, Chris Chesney wrote:

> We've done it like this.  Ugly, but it works.  Is there a better  
> way or
> is it worth adding some functionality to the iterate tag?
>
> <string-to-list string="1" list-name="counter"/>
> <string-to-list string="2" list-name="counter"/>
> <string-to-list string="3" list-name="counter"/>
> <string-to-list string="4" list-name="counter"/>
> <string-to-list string="5" list-name="counter"/>
> <iterate list-name="counter" entry-name="currentRow">
>     ...
>     <calculate field-name="fundsItemId" type="Integer">
>         <calcop operator="add" field-name="currentRow"/>
>     </calculate>
>     ...
> </iterate>
>
> -Chris
>
>
>> -----Original Message-----
>> From: dev-bounces at lists.ofbiz.org [mailto:dev- 
>> bounces at lists.ofbiz.org]
>>
> On
>
>> Behalf Of Si Chen
>> Sent: Monday, July 18, 2005 10:50 AM
>> To: OFBiz Development
>> Subject: [OFBiz] Dev - looping in simple-xml
>>
>> Is there anyway to loop a number of times in simple-xml, such as
>>
>> for (i = 0; i < 5; i++) {
>> ...
>> }
>>
>> ?
>>
>> Thanks,
>>
>> Si
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/dev
>>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/dev
>



More information about the Dev mailing list