ken4ward
2014-07-16 08:44:45 UTC
The value in doc.db.persons.personname[0] is thomas.
<#global y = doc.db.persons.personname[0]>
[#foreach item in doc.db.persons]
<#if y != "thomas">
yes, it is ok
<#else>
no, remove it
</#if>
[/#foreach]
Check the code snippet above, it's definite that something is wrong with it,
kindly help me fix it. The problem is that the Freemarker interpreter does
not interpret the foreach statement, only the if statement it interprets.
When compiled it gives an output thus:
Output
[#foreach item in doc.db.persons]
yes, it is ok
[/#foreach]
So my question is what better way can I write this code for both statements
to be interpreted? Hoping to have your take on this. Thanks.
--
View this message in context: http://freemarker.624813.n4.nabble.com/Nesting-if-statement-and-foreach-statement-tp4655207.html
Sent from the freemarker-user mailing list archive at Nabble.com.
<#global y = doc.db.persons.personname[0]>
[#foreach item in doc.db.persons]
<#if y != "thomas">
yes, it is ok
<#else>
no, remove it
</#if>
[/#foreach]
Check the code snippet above, it's definite that something is wrong with it,
kindly help me fix it. The problem is that the Freemarker interpreter does
not interpret the foreach statement, only the if statement it interprets.
When compiled it gives an output thus:
Output
[#foreach item in doc.db.persons]
yes, it is ok
[/#foreach]
So my question is what better way can I write this code for both statements
to be interpreted? Hoping to have your take on this. Thanks.
--
View this message in context: http://freemarker.624813.n4.nabble.com/Nesting-if-statement-and-foreach-statement-tp4655207.html
Sent from the freemarker-user mailing list archive at Nabble.com.