Template processor
템플릿 프로세서(Template processor), 템플릿 엔진(template engine), 템플릿 파서(template parser)는 결과 문서를 생성하기 위해 데이터 모델과 템플릿을 결합하도록 설계된 소프트웨어이다. 템플릿들이 개발되는 언어는 템플릿 언어라고 부른다.
A template processor (also known as a template engine, template parser or template language) is software or a software component that is designed to combine one or more templates with a data model to produce one or more result documents. For purposes of this article, a result document is any kind of formatted output, including documents, web pages, or source code, either in whole or in fragments.
System elements
All template processing systems consist of at least these primary elements:
- an associated data model;
- one or more source templates;
- a processor or template engine;
- generated output in the form of result documents.
- Data model.
- This may be a relational database, a source file such as XML, an alternate format of flat file database, a spreadsheet or any of other various sources of preformatted data. Some template processing systems are limited in the types of data that can be used. Others are designed for maximum flexibility and allow many different types of data.
- Source template.
- Source templates are traditionally specified:
- according to a pre-existing programming language;
- according to a specially-defined template language;
- according to the features of a hosting software application; or
- according to a hybrid combination of some or all of the above.
- Template engine.
- The template engine is responsible for:
- connecting to the data model;
- processing the code specified in the source templates; and
- directing the output to a specific pipeline, text file, or stream
- Additionally some template engines allow additional configuration options.
- Result documents.
- These may consist of an entire document or a document fragment.
See also
- Source code generation
- Documentation generator
- Web template system - 웹에서 사용하는 템플릿 엔진