什么时候冬天| cool什么意思中文| 剖腹产什么时候可以洗澡| 男同叫什么| 飞机联程票是什么意思| 牛蛙不能和什么一起吃| 义字少一点念什么| 胰腺ca是什么意思| 肌层回声均匀是什么意思| 痰湿瘀阻是什么症状| 10月28号是什么星座| 什么是阴蒂| 查血糖挂什么科| 四大美女是什么生肖| 洗面奶什么好| 入伏吃什么| 时间观念是什么意思| 金融行业五行属什么| 花胶是什么东西| 金达莱是什么花| 给男人补身体煲什么汤| 一什么无什么| 属马的人佩戴什么招财| 晚上睡觉老做梦是什么原因| 核磁共振挂什么科| 欧诗漫是个什么档次| 诺如病毒吃什么药最有效| 得了子宫肌瘤注意什么| 什么叫高血压| 道什么意思| 三伏天吃什么| 骨质疏松用什么药好| 冒昧打扰是什么意思| 13点是什么意思| 孙悟空最后成了什么佛| 咳嗽什么东西不能吃| 梦见采蘑菇是什么预兆| hrv什么意思| 胃肠炎可以吃什么水果| 糖类抗原高是什么意思| 奶酪是什么东西| 做什么运动可以瘦腿| 后羿是什么生肖| 被紫外线灯照到有什么后果呀| 早餐吃什么不升血糖| elle中文叫什么| prc什么意思| 夏天脚开裂是什么原因| 七月十五有什么禁忌| 突然头晕恶心是什么原因| 济公属什么生肖的| 参苓白术散治什么病| 润色是什么意思| 梳头有什么好处| 吃什么补充维生素| 什么是无产阶级| 锖色是什么颜色| 茴香是什么| 颈椎应该挂什么科| 6月20号是什么星座| 胎儿窘迫什么意思| 砂锅是什么材料做的| 早餐吃什么最营养| 喉咙疼挂什么科| 癌症晚期吃什么食物好| 江郎才尽是什么意思| 1964年是什么年| 眼睛流眼泪用什么眼药水| 小孩脸肿是什么原因引起的| 风调雨顺是什么生肖| 类风湿关节炎不能吃什么食物| 上户口需要什么资料| bolon是什么牌子眼镜| 什么炖鸡汤好喝又营养| 魂穿是什么意思| uc是什么| 幽会是什么意思| 血糖高的人吃什么水果| 阑尾炎看什么科室| 束手无策是什么意思| 月经期间能吃什么水果| 胖大海是什么东西| 属蛇的五行属什么| 山竹有什么功效和作用| 结婚是什么意思| 做牛排需要什么调料| 小产和流产有什么区别| 什么叫点映| 相声海清是什么意思| 杀青是什么意思| 避孕套是什么| 乳头痒用什么药| 汗味酸臭是什么原因| 女人来月经吃什么好| 女人出虚汗失眠吃什么药| 什么国家的钱最值钱| 老白茶是什么茶| 不应期是什么意思| 头孢不能和什么食物一起吃| 身份证拍照穿什么衣服| 什么时候有流星| 镇党委副书记是什么级别| AUx是什么品牌| 卷腹是什么| 着床是什么意思| 抱持是什么意思| 什么的腊梅| 亡羊补牢的亡是什么意思| 大什么大| 拔罐后发痒是什么原因| 安宫牛黄丸为什么那么贵| 暑假是什么时候| 宫颈分离是什么意思| 脚筋膜炎什么办法恢复的最快| 今天是什么日子老黄历| 社交恐惧是什么| 三严三实是什么| r13是什么牌子| 词牌名是什么意思| 娥皇女英是什么意思| 凿壁偷光形容什么| 大姨妈吃什么| cpv是什么病毒| 皮疹用什么药| 眼睛痛用什么药| 不要问为什么| 腐竹和什么一起炒好吃| 今天什么冲什么| 小暑大暑是什么意思| hl是什么意思| 手老是出汗是什么原因| 胆囊炎是什么| 黑魔鬼烟为什么是禁烟| 主动脉夹层是什么病| 狗吃什么| 鼻甲肥大吃什么药最好| 本是什么生肖| 南京市市长什么级别| 咖啡有什么作用和功效| 过什么不什么| 什么是阳痿| 儿童便秘吃什么最管用| 为什么小腿肌肉酸痛| 北方人立秋吃什么| 敖包是什么意思| 宝宝缺钙吃什么补得快| 别人是什么意思| 农垦局是什么性质单位| 忌诸事不宜是什么意思| 12岁生日有什么讲究| 什么是体外射精| 身体动不动就出汗是什么原因| 肌酐300多属于什么期| 淋巴细胞绝对值偏高是什么意思| 斛什么意思| 皮蛋是什么蛋| 刮宫和流产有什么区别| 卧底归来大结局是什么| 肾病吃什么水果好| 芒种是什么意思| 黄水疮是什么原因引起的| bml什么意思| 武汉都有什么区| 三顾茅庐是什么意思| 什么补血| 什么的舞姿| 玉是什么结构的字| 黄牌车是什么意思| 梦到火是什么意思| 厌氧菌感染用什么药| 宜夫痣是什么意思| 舍本逐末什么意思| 大什么大| 大便黄绿色是什么原因| 铂字五行属什么| sj是什么| 一什么而什么的成语| 缪斯女神什么意思| 下雨为什么会打雷闪电| 梦见结婚是什么意思| 老人说胡话是什么征兆| 弈字五行属什么| 葡萄的茎属于什么茎| 六安瓜片属于什么茶| 婴儿坐飞机需要什么证件| 男人脚底有痣代表什么| 菠萝蜜过敏什么症状| 什么样的头发| 什么运动有助于长高| 长期打嗝是什么原因| 胎儿股骨长是什么意思| 肾结石要忌口什么东西| 罗汉果泡水喝有什么作用| 秦皇岛有什么特产| 冥冥中是什么意思| 嘴唇起泡是什么原因| 画是什么生肖| 痔疮是什么样子的图片大全| 陕西的特产有什么| 咖啡因是什么| gopro是什么意思| 蜂蜜有什么作用与功效| 电势是什么| 1973年属什么生肖| 左侧肋骨下面是什么器官| 睡觉憋气是什么原因引起的| 女人绝经一般在什么年龄段| 痔疮是什么意思| 7月6日是什么星座| 为什么拉肚子| 5月30是什么星座| 手淫导致的阳痿早泄吃什么药| 车加昆念什么| 口腔溃疡吃什么药好的快| 名号是什么意思| 血糖和尿糖有什么区别| 拉杆箱什么材质好| 眼震电图能查什么病| lomo卡是什么| hpv感染后有什么症状| 脸上长粉刺是什么原因| 阿鼻地狱是什么意思| 苟不教的苟是什么意思| 净空是什么意思| 走南闯北是什么生肖| 黎山老母什么级别神仙| 分解酒精的是什么酶| 深圳市长是什么级别| 嘴涩是什么原因造成的| 糖耐量受损是什么意思| 什么是直流电| 天空是什么颜色| 窦性心律过速是什么意思| 肠系膜脂膜炎是什么病| 巴子是什么意思| 为什么会腰疼| 脚气看什么科| 太多的借口太多的理由是什么歌| 工薪阶层是什么意思| 变应原皮内试验是测什么的| 眼睛吹风就流泪是什么原因| 7月有什么活动| 鼻甲肥大是什么原因| 什么是直流电| 吃了拉肚子的药叫什么| 法兰克穆勒什么档次| 斐乐属于什么档次| 玄米是什么米| 西楚霸王是什么生肖| 体面什么意思| 胃胀吃什么水果| youngor是什么牌子| 什么是处男| 结石用什么药| 绝望的绝是什么意思| 抗皱用什么产品好| eb病毒抗体阳性是什么意思| 1点到3点是什么时辰| igm是什么| 京东快递是什么快递| 所言极是是什么意思| 养什么鱼招财转运| 98年属相是什么| 大便干燥一粒一粒的吃什么药| 百度

自媒体做号产业链"10万+"多抄袭拼凑 不能坐视不管

百度 据俄新社布宜诺斯艾利斯3月21日报道,G20财长和央行行长将大部分注意力放在与加密货币有关的问题上。

A template processor (also known as a template engine or template parser) is software designed to combine templates with data (defined by a data model) to produce resulting documents or programs.[1][2][3] The language that the templates are written in is known as a template language or templating language. For purposes of this article, a result document is any kind of formatted output, including documents, web pages, or source code (in source code generation), either in whole or in fragments. A template engine is ordinarily included as a part of a web template system or application framework, and may be used also as a preprocessor or filter.

A diagram illustrating all of the basic elements and processing flow of a template engine.

Typical features

edit

Template engines typically include features common to most high-level programming languages, with an emphasis on features for processing plain text.

Such features include:

Embedded template engines

edit

While template processors are typically a separate piece of software, used as part of a system or framework, simple templating languages are commonly included in the string processing features of general-purpose programming languages, and in text processing programs, notably text editors or word processors. The templating languages are generally simple substitution-only languages, in contrast to the more sophisticated facilities in full-blown template processors, but may contain some logic.

Simple examples include ‘printf’ print format strings, found in many programming languages, and snippets, found in a number of text editors and source code editors. In word processors, templates are a common feature, while automatic filling in of the templates is often referred to as mail merge.

An illustrative example of the complementary nature of parsing and templating is the s (substitute) command in the sed text processor, originating from search-and-replace in the ed text editor. Substitution commands are of the form s/regexp/replacement/, where regexp is a regular expression, for parsing input, and replacement is a simple template for output, either literal text, or a format string containing the characters & for "entire match" or the special escape sequences \1 through \9 for the nth sub-expression. For example, s/(cat|dog)s?/\1s/g replaces all occurrences of "cat" or "dog" with "cats" or "dogs", without duplicating an existing "s": (cat|dog) is the 1st (and only) sub-expression in the regexp, and \1 in the format string substitutes this into the output.

System elements

edit

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

edit

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

edit

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

edit

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

edit

These may consist of an entire document or a document fragment.

Uses

edit

Template processing is used in various contexts for different purposes. The specific purpose is ordinarily contingent upon the software application or template engine in use. However, the flexibility of template processing systems often enables unconventional uses for purposes not originally intended by the original designers.

Template engine

edit

A template engine is a specific kind of template processing module that exhibits all of the major features of a modern programming language. The term template engine evolved as a generalized description of programming languages whose primary or exclusive purpose was to process templates and data to output text. The use of this term is most notably applied to web development using a web template system, and it is also applied to other contexts as well.[4]

Document generation

edit

Document generation frameworks typically use template processing as the central model for generating documents.

Source code generation

edit

Source code generation tools support generation of source code (as the result documents) from abstract data models (e.g., UML, relational data, domain-specific enterprise data stores) for particular application domains, particular organizations, or in simplifying the production process for computer programmers.

Software functionality

edit

A web template engine processes web templates and source data (typically from a relational database) to produce one or more output web pages or page fragments. It is ordinarily included as a part of a web template system or application framework. Currently, template processing software is most frequently used in the context of development for the web.

Comparison

edit

XSLT is a template processing model designed by W3C. It is designed primarily for transformations on XML data (into web documents or other output).

Programming languages such as Perl, Python, PHP, Ruby, C#, Java, and Go support template processing either natively, or through add-on libraries and modules. JavaServer Pages,[5] Active Server Pages,[6] Genshi (for Python), and eRuby are examples of template engines designed specifically for web application development.

Moreover, template processing is sometimes included as a sub-feature of software packages like text editors, IDEs and relational database management systems.

Benefits of using template engines

edit
  • encourages organization of source code into operationally-distinct layers (see e.g., MVC)
  • enhances productivity by reducing unnecessary reproduction of effort
  • enhances teamwork by allowing separation of work based on skill-set (e.g., artistic vs. technical)

See also

edit

References

edit
  1. ^ Niemeyer, Patrick (2002). Learning Java. Sebastopol: O'Reilly. ISBN?0-596-00285-8.
  2. ^ Manolescu, Dragos (2006). Pattern Languages of Program Design 5. Reading: Addison-Wesley Professional. ISBN?0-321-32194-4.
  3. ^ Fowler, Martin (2003). Patterns of Enterprise Application Architecture. Boston: Addison-Wesley. ISBN?0-321-12742-0.
  4. ^ (see e.g., Velocity, TemplateToolkit, Freemarker ).
  5. ^ JavaServer Pages is a technology released by Sun for use with the Java programming language. "JavaServer Pages Technology". 2025-08-14. Retrieved 2025-08-14.
  6. ^ ASP 1.0 was originally released for use with Microsoft VBScript and JScript. It was an extension to Microsoft IIS.
edit
抗hbs阳性是什么意思 又拉肚子又呕吐是什么原因 吃什么东西补铁 木耳不能和什么一起吃 党参和丹参有什么区别
shadow是什么意思 世袭制是什么意思 奥利司他是什么药 乙肝是什么病严重吗 假体隆胸什么材料好
fop是什么意思 大拇指脱皮是什么原因 水马是什么 空气栓塞取什么卧位 流产期间吃什么好
猫咪疫苗什么时候打 水鱼是什么 字义是什么意思 头疼流鼻血是什么原因 7月13日是什么节日
什么颜色加什么颜色是黄色hcv8jop4ns2r.cn 抽烟对身体有什么危害hcv8jop5ns6r.cn 手指长痣代表什么hcv7jop4ns6r.cn 油性皮肤适合用什么护肤品hcv7jop5ns2r.cn 疱疹是什么原因引起的hcv9jop0ns1r.cn
打闭经针有什么副作用hcv7jop7ns3r.cn 吃什么长胖hcv8jop0ns9r.cn 猹是什么hcv8jop4ns2r.cn 故步自封是什么意思hcv8jop8ns6r.cn 什么鱼最迟钝youbangsi.com
尿血是什么病的征兆sanhestory.com 龙马精神代表什么生肖hcv8jop7ns2r.cn 一直咳嗽不好是什么原因hcv7jop6ns0r.cn 防血栓是什么意思onlinewuye.com 为什么有的人怎么吃都不胖xjhesheng.com
桃花劫是什么意思hcv9jop6ns1r.cn 肠子粘连有什么办法解决hcv8jop2ns2r.cn 养成系是什么意思wmyky.com 感冒吃什么药hcv9jop2ns5r.cn 甘油三酯高吃什么食物好hcv7jop4ns5r.cn
百度