[stringtemplate-interest] Newbie- if conditional question

Bharani Ellore bharani at ti.com
Thu Mar 26 15:33:52 PDT 2009


I have the code in my template.st

$outputs: { bo |

       $if(length(strip(bo.sourceWire)))$

            $bo.label$ zzz

        $endif$

}$


where bo.sourceWire is a <list>. Basically I was to print the label if 
the itemList has atleast one string. But somehow it is printing all the 
items in $bo$ even though some of them are empty lists.

This expression does print number ranging from 0-9. So I know all item 
should not be printed.
$length(strip(bo.sourceWire))$


What am I doing wrong? Any help?

-Bharani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20090326/dac4deda/attachment.html 


More information about the stringtemplate-interest mailing list