madhavrao… » Text Template
Text Template Transformation Toolkit (T4) is used primarily for tools like Guidance Automation Toolkit (GAT) and Domain Specific Language (DSL).
T4 allows processing of text templates. Text templates is a file that contains mixture of text and control logic.When T4 transform a text template, the control logic combines the text blocks with the data in a model to produce an output file. One can use text templates to create text artifacts such as code files and HTML reports.
The following are examples of tasks that can be performed by using text templates:
- After creating models, one can iterate over their in-memory-representation (instead of their raw XML representation) to generate arbitrary text.
- One can generate custom code by using either Visual C# or Visual Basic to navigate through a model.
- One can generate custom reports in XML or HTML.
T4 can be used with both Visual Studio 2005 and Visual Studio 2008.
Clarius Consulting has developed a free download called the T4 Editor that integrates the T4 design-time experience directly into Visual Studio 2005 and 2008, in the process offering support for colorization of directives, code and text blocks, IntelliSense and design-time previews of templates. The download supports Visual Basic and C# in control logic.
T4 can also be used outside Visual Studio in custom tool, also command line transformation tool “TextTransform.exe” is readily available to be used outside Visual Studio. There is good information available on MSDN on how to use “Command Line Tools for Text Template”