[stringtemplate-interest] char replacement

Terence Parr parrt at cs.usfca.edu
Wed Sep 12 09:28:01 PDT 2007


On Sep 12, 2007, at 3:27 AM, Zdenek Vrablik wrote:

> Hi all,
>
> I haven't found anything about string replacement in string template.

ST is side-effect free.  You need to alter data in the model or use a  
"renderer" object wrapper or use the format option.

Ter

> I need replace all occurrences of ' with ''. But this is for only  
> one type
> of output. Other (XML) output shouldn't get such data.

A renderer.  Just override setAttribute to autowrap strings in an  
object that replaces that stuff.

Ter


More information about the stringtemplate-interest mailing list