[stringtemplate-interest] multivalue checking

Kay Roepke kroepke at dolphin-services.de
Thu May 25 14:23:59 PDT 2006


On 25. May 2006, at 23:14 Uhr, John RW wrote:

> Well, I think this does not quite answer my question:
>
>   You code is
>     $if(foo)$  foo $else$ bar $endif$
>
>   what I want is something like:
>
>   $if there_is_one_true(foos)$ foo $else$ bar $endif$

Oh, I'm sorry, misunderstood you there.

There is no way to do that in ST itself, as ST be design doesn't  
allow expressions in templates. You'll need to pass in some attribute
like hasMultipleFoos or singleFoo or whatever and test that with an if.
You can test for true/false, null/not null, empty list/non-empty list  
but not for list has n elements.

-k


More information about the stringtemplate-interest mailing list