[stringtemplate-interest] need for null test

Oliver Flege o.flege at market-maker.de
Mon Jan 17 01:30:37 PST 2011


Hi,

we use an enhanced version of ST3 for xml rendering and while ST4 makes
most of our enhancements obsolete (in particular by supporting adaptors),
one crucial omission remains:

In order to render Boolean types declared as "xsd:boolean nillable=true" in an xsd,
we need to distinguish between false and null values, as the output has to
be either
<tag>false</tag> or <tag nil="true"/>, respectively.

I couldn't find any way to express this logic using ST4's if statement
given a Boolean attribute, as false and null both evaluate to false.

If that kind of logic can be expressed in ST4, I'd really appreciate any hint
on how its done; otherwise I think that a "test for null"-expression should be added
to the language, e.g., "if (?foo) ... "



Regards,
 Oliver




More information about the stringtemplate-interest mailing list