Iterate a Set of data
Geeth Lochana <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
I have collection of data, record as like follows.
Class RiskSummaryRpt{
private String name;
private String value;
}
Class Report{
private Set<Abc> riskSummaryRpt;
}
i want to get following out put using freemarker template
using above collection i want to get single record.
this is the current template i have
<#list report.riskSummaryRpt as param>
<#if param.name == 'Factor'>
<factor>
<risk>${param.riskVal!""}</risk>
</factor>
<#elseif param.name == 'Stock Specific'>
<specific>
<risk>${param.riskVal!""}</risk>
</specific>
<#elseif param.name == 'Total'>
<totalVariance>
<risk>${param.riskVal!""}</risk>
</totalVariance>
</#if>
</#list>
i need to get following output with correct order of tags.
<factor>
<risk>12.32</risk>
</factor>
<specific>
<risk>12.32</risk>
</specific>
<totalVariance>
<risk>12.32</risk>
</totalVariance>
but i couldn't get the order is mismatch.
Any one have any idea to over come this issue.
--
View this message in context: http://freemarker.624813.n4.nabble.com/Iterate-a-Set-of-data-tp3836641p3836641.html
Sent from the freemarker-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2