if (template != null) {
IDocument document = new Document();
DocumentTemplateContext context = getContext(contextTypeRegistry,
template, containerName, fileName, document);
if (context instanceof PhpTemplateContext) {
PhpTemplateContext phpTemplateContext = (PhpTemplateContext) context;
phpTemplateContext.setLineDelimiter(lineDelimiter);
}
TemplateBuffer buffer = null;
try {
buffer = context.evaluate(template);
} catch (BadLocationException e) {