[stringtemplate-interest] Spaces around template attributes

Michael micha-1 at fantasymail.de
Wed Apr 29 07:59:21 PDT 2009


Am Wednesday 29 April 2009 16:43:30 schrieb Steve Ebersole:
> I am trying to deal with extra spaces in my stringtemplate output when
> attribute values used within the template are null/empty.  I figure this
> has to be a pretty common requirement, so I thought I'd ask here how to
> accomplish this.
>
> For example, I have a template like:
> sortSpecification(sortKey,collationSpecification,orderingSpecification) ::=
> << <sortKey> <collationSpecification> <orderingSpecification>
>

you can try it with list construction, *untested* :

sortSpecification(sortKey,collationSpecification,orderingSpecification) ::=
<<
<[sortKey, collationSpecification, orderingSpecification]; separator=' '>
>>


 Michael



More information about the stringtemplate-interest mailing list