I wrote the following StringTemplate template lines:
<instance.attributes: { attr | <attr.value>}>
<instance.attributes: { attr | <if(attr.value)>skip<else>don't skip<endif> } >
in order to write skip if the Object value return by Instance.getAttributes().getValue() is a boolean which value is true.
This result in
1
skip
and
0
skip
(for now I only have one attribute)
What is the problem and why I don’t get ?
0
don't skip
From the StringTemplate wiki
I assume that 0 means not
false, but some value that indicates presence of value and evaluates to true. You need to compute boolean value that evaluates to false before pushing it to the template.