9. 更高级的文本输出工具 You can enclose a block of template in a set of tags that will cause it to apply HTML escaping or XML escaping (or any other transformation you can express as a
FreeMarker expression for that matter) on all interpolations (${foo}) in the block. FreeMarker has transforms, which are blocks of template that when rendered, go through a transforming filter. Built-in transforms include whitespace compressor,
HTML and XML escaper. Best of all, you can implement your own transformers as well (i.e. if you generate Java source code, you can write a Java code pretty-printer transform and insert it into the template). Naturally, transforms can be nested. You can explicitly flush the output writer with a built-in flush-directive. You can stop the rendering with a built-in stop-directive.